how to save JSON data into SDCard phoneGap - json

We have sqLite Table.Now We converted db data into JSON Object.We need JSON data save to my mobile Sd_Card.Any file like .txt or excel or word any type of format not problem.
We need JSON data Save to Local phone-memory or SD-Card.guide me how to save.First Tell me it's possible or not

Well, all you are asking is if it is possible, so that's easy, yes. You said "phone memory" or SD-Card. I assume you mean persistent memory, like with WebSQL. Since JSON is just a string, you can insert it into a WebSQL table just fine. You could also, more easier, store it in LocalStorage. Finally, if you want to use the file system, that's simple too, just be sure to add the File plugin.

Related

How do we name the files that are streamed via firehose?

I'm building an architecture using boto3, and I hope to dump the data in JSON format from API to S3. What blocks in my way right now is first, firehose does NOT support JSON; my workaround right now is not compressing them but it's still different from a JSON file. But I still want to see a better choice to make the files more compatible.
And second, the file names can't be customized. All the data I collected will be eventually converted onto Athena for the query, so can boto3 do the naming?
Answering a couple of the questions you have. Firstly if you stream JSON into Firehose it will write JSON to S3. JSON is the file data structure and compression is the file type. Compressing JSON doesn't make it something else. You'll just need to decompress it before consuming it.
RE: file naming, you shouldn't care about that. Let the system name it whatever. If you define the Athena table with the location, you'll be able to query it. When new files are added, you'll be able to query them immediately.
Here is an AWS tutorial that walks you through this process. JSON stream to S3 with Athena query.

How to store a blob of JSON in Airtable?

There does not appear to be a dedicated field type in Airtable for "meta" data blobs and/or a JSON string.
Is the "Attachment" type my best bet?
I could store it either as a json attachment, or on a String type column.
Since a full json on a text column would likely not be readable, I would store it as attachments.
However, it seems that at least for now, uploading attachments require the file to be already hosted somewhere first, so this route might not be the easiest one:
https://community.airtable.com/t/is-it-possible-to-upload-attachments/188
Right now this isn’t possible with the Airtable API alone. It’s
something we’ll think about for future API versions though. A
workaround for now is to use a different service
(e.g. Filestack90, imgur52, etc.) to process the upload before then
sending the url to Airtable. When Airtable processes the attachment,
it will copy the file to Airtable’s own (S3) server for safekeeping,
so it’s OK if the original uploaded file url is just temporary

AWS Glue Crawler Classifies json file as UNKNOWN

I'm working on an ETL job that will ingest JSON files into a RDS staging table. The crawler I've configured classifies JSON files without issue as long as they are under 1MB in size. If I minify a file (instead of pretty print) it will classify the file without issue if the result is under 1MB.
I'm having trouble coming up with a workaround. I tried converting the JSON to BSON or GZIPing the JSON file but it is still classified as UNKNOWN.
Has anyone else run into this issue? Is there a better way to do this?
I have two json files which are 42mb and 16mb, partitioned on S3 as path:
s3://bucket/stg/year/month/_0.json
s3://bucket/stg/year/month/_1.json
I had the same problem as you, crawler classification as UNKNOWN.
I were able to solved it:
You must create custom classifier with jsonPath as "$[*]" then create new crawler with the classifier.
Run your new crawler with the data on S3 and proper schema will be created.
DO NOT update your current crawler with the classifier as it won't apply the change, I don't know why, maybe because of classifier versioning AWS mentioned in their documents. Create new crawler make them work
As mentioned in
https://docs.aws.amazon.com/glue/latest/dg/custom-classifier.html#custom-classifier-json
When you run a crawler using the built-in JSON classifier, the entire file is used to define the schema. Because you don’t specify a JSON path, the crawler treats the data as one object, that is, just an array.
That is something which Dung also pointed out in his answer.
Please also note that file encoding can lead to JSON being classified as UNKNOWN. Please try and re-encode the file as UTF-8.

AS3 Sending a Shared Object

I'm working on an application that would allow users to create a custom character sheet for role play games. I have most of the code figured out, but I want users to be able to send their character sheets between devices.
So here's the question: is there a way to save and send a shared object file, or a way to create a txt file that can easily be saved and copied?
I don't believe you can send a SharedObject from one device to another, at least without a lot of work. You could however create an XML file containing the data and save that up to a server. You could allow the user to then download character sheets from your server and the app would read the XML data before converting to a SharedObject. Can't really provide any code for this as the details are lacking.
If I understand you correctly, you could sort of do this.
You cannot literally "send and receive" a SharedObject (well, you might be able to copy your shared object data on the file system directly, but not from Flash).
What you can do is provide options to the user to save and load a file that encodes all the shared data in AMF bytes. Here's the general idea:
First you need to give the user an option to save their data. You can use ByteArray/writeObject() to write your data using the same AMF format that SharedObjectuses, and FileReference/save() to allow the user to save it to a file on their file-system.
Next, you can use FileReference/load() to load the file and ByteArray/readObject() to read all the data into AS3. Now you can simply store it in the SharedObject however you want, just like you did before.

How to localise JSON data for windows phone 8 app

I have JSON data which has say three levels of nesting.I need to support localization of my app.I can find resources on how to create res file and support multiple languages,But they all seem to be for a single string.How do I place my nested JSON data in res file??
There are two simple ways to solve the problem that may work for you:
Depending on the size of the JSON file, you can just store the stringified JSON data as a string resource. For small amounts of data, it's a simple solution.
For larger files, I'd suggest instead that you store a file name/path which points at the corresponding JSON file that is appropriate for the current locale. You'd just load the file based on the file name provided in the resource at run time.