Does anyone know what the size limit is of a JSON file in PhoneGap 3.0?
I access an external JSON file to populate a carousel gallery. When the JSON file was like 20KB size everything worked perfect but when I tested with 200KB the app began to lag really bad and if I use a bigger file like 500KB, the app gives an alert than it's unable to access the file. I tried to access the file from the server and from direct file in the app... same result.
So did anyone experience a similar problem or does someone know if there is a better solution to this?
Maybe SQLite ? Or how about using MySQL on the server and only exporting the JSON for the necessary query?
This discussion might help you. What they are saying is to
break the data up into chunks
load each in, and save off to SQLite
Hope this is what you looking for. Cheers!
Related
I am new to Android Programming and would like to ask about JSON/sqlite. I have already parsed JSON text and store it in sqlite and then displayed the data in a listview in my app. However, I didn't parse the images in my JSON file (started with the easy part first). Now I have to do the image parsing and I have looked through many websites but still feel too confused about how to do it.
In the following link
http://www.androidbegin.com/tutorial/android-json-parse-images-and-texts-tutorial/
I have looked at how they do the image parsing but they're caching the images while I have to store the data into DB. In the link there is ImageLoader.java, MemoryCache.java, FileCachee.java,and Utils.java; these classes made me even more confused, do I need all of these for the images?
Can anyone please guide me like what steps I should follow? which classes of these do I need and which are not necessary?Or any kind of help.
Thank you in advance
To read in a single image, no you don't need all that. All you need is to read in an array of bytes (the contents of the file) and turn that into a Bitmap object. What all that is useful for is to hold lots of images at once- to make sure you don't use up too much RAM (MemoryCache), request them from the network more than once (FileChace), and to manage all of those (ImageLoader). So if you want to download lots of images its useful. For a single one its overkill.
I am building an Android app for a client and most of the data that i need is contained in an online .txt file attached to my clients website. I've never used an online .txt file as a data source before and don't really know where to begin?! Can anyone point me in the direction of a good tutorial on the subject.
Many Thanks in advance
P.S. I haven't asked whether it's possible because i have assumed it is due to the fact you can use an internal .txt file as a data source
I think the best approach is to download the file on the device and then read it like a normal file. If the file changes on a period of time, then configure the app to download and read the file and then update the local info in the app.
I don't think you can use an online txt as a DataSource, but you can implement this so you have an abstract source for your file, and then just call read on it.
Expose the txt/xml file over web,if you want to get it down to phone use URL loader and load it to the phone and operate if you want to use it online (like others may also be using it) it will be a bit complex in order to deal with data coming from more then one source but possible. clear you question a bit more.
I would like to access the string-files stored in an sqlite database created for an ios application.
Any suggested methods to do this? I have searched all over the net but have not found anyone who has done this.
I know it is possible to convert a plist file to an xml file, but in the future the app I am working on will get all the resources (including strings) from a server.
I hope someone can help with this.
You could just include the SQLite database file as an asset in your app then use it like any other SQLite DB in Android.
You then mention that you will get resources from the server and I assume from your question that the data is currently in pLists so I think there may be 2 questions in one?
You might consider using JSON which, in many cases, is much faster than parsing XML. I recently used "Sublime Text" to convert a bunch of plists to JSON. It did a great job. v1 of my app parsed pLists. I tried SAX, DOM and the pull parser to find the quickest (SAX in this case) but, after conversion to JSON, v2 of the app is much, much faster. I haven't measured it because I don't need to. The user experience is enough. Where I previously had to use a loading progress dialog on a particularly large pList, with the new JSON parser, the UI is responsive at all times.
I am developing an Android application and got a SQLite database in it, which has quite a lot of rows and columns. Showing those inside the application is no problem, but I want to export the information of the database as a PDF file to upload it to Dropbox or the SD card.
I found a way to create a PDF file within the application from a bitmap file, but that doesn't help me much. The information of the database can only be seen in the application by scrolling around, as it is to big for the screen. Is there a solution for this problem?
Exporting a screenshot as PDF won't help me much as not the whole database can be seen within one screen.
I'd look for some reporting solution for example http://jasperforge.org/projects/jasperreports possibly on the server side.
You can also try iText which is very low level.
Generate the bitmap in your software from or in parallel with the generation of what the users sees, write it out as a file, and give it to the pdf generator.
I my application one issue is there. please suggest how to do it.
Issue: Downloading the images from the web and how to use it in the app.
For this , first i am downloading the images from the web and these images are stored in the sdcard dynamically. But here i am getting out of memory exception. one more problem is there it is not working in the mobiles which don't have sdcard.
Please suggest the better way how to do it. can any body help me.
thanks
I had similar and mulitple problems,
check my post ,
hope it helps:)
Request time failed : java.net.socketexception : Address family not supported by protocol
feel free to ask the doubts