Android :: Save Data Structures In Android?
Sep 24, 2009
I want to store some data from structures like this:
...........................
I want to save it to an external file on the sdcard of my device so that other apps can read it (and users can open/copy it). I thought I should use a DOM parser because my data structures are not very big, but I find no tutorials or anything like that. Is there a better way to store this information? how to use the parsers in android?
View 1 Replies
May 2, 2010
I've started working on some Android applications and have a question regarding how people normally deal with situations where you have a static data set and have an application where that data is needed in memory as one of the standard java collections or as an array.
In my current specific issue i have a spreadsheet with some pre-calculated data. It consists of ~100 rows and 3 columns. 1 Column is a string, 1 column is a float, 1 column is an integer. I need access to this data as an array in java.
It seems like i could:
1) Encode in XML - This would be cpu intensive to decode in my experience.
2) build into SQLite database - seems like a lot of overhead for static access to data i only need array style access to in ram.
3) Build into binary blob and read in. (never done this in java, i miss void *)
4) Build a python script to take the CSV version of my data and spit out a java function that adds the values to my desired structure with hard coded values.
5) Store a string array via androids resource mechanism and compute the other 2 columns on application load. In my case the computation would require a lot of calls to Math.log, Math.pow and Math.floor which i'd rather not have to do for load time and battery usage reasons.
I mostly work in low power embedded applications in C and as such #4 is what i'm used to doing in these situations.
It just seems like it should be far easier to gain access to static data structures in java/android.
Perhaps I'm just being too battery usage conscious and in my single case i imagine the answer is that it doesn't matter much, but if every application took that stance it could begin to matter.
View 3 Replies
View Related
Feb 17, 2010
The object passing between an Android service and the remote binder is happening through serialization of the object. If the service needs to return a very large collection, it seems very inefficient to use this. What is the recommended way to deal with this?
View 1 Replies
View Related
May 15, 2014
I primarily do hardware and firmware design, but a new product my company is developing has the need for an Android app and since I have the most Android programming experience (which is extremely limited) that leaves the task to me. I need a little guidance figuring out how to do a few things so that I can get this app up and running. I already have a simple GUI to display some stuff, but what I need is a way to handle data.
I am trying to receive a 148 byte stream of data over a serial connection, parse it into a structure and display certain values from that structure. The data is packed in a struct that is sent from a micro controller and due to that it has a very specific layout (i.e. the first 8 bytes mean this, the next 16 bytes are this... ). In C, I can just declare a struct with those values and use the #pragma pack function to eliminate any extra spacing the compiler would otherwise inject for alignment purposes, receive the data and do a memcpy into the struct to write the data. It's not the safest or cleanest way to do it, but it takes very little time and if you do CRC tests to make sure the data received is valid it works like a charm.
Now to the root of the problem: How do I declare structs in Java? Is there a way to pack them tightly like you can using C? Once I've received the binary data, is there a way to parse it into the structure easily? These are the issues we hardware programmers face when dealing with Java...
View 2 Replies
View Related
Sep 16, 2010
On Thu, Sep 16, 2010 at 10:10 AM, Lidia <lidyp...@yahoo.com> wrote: > And using the "internal storage" data are always removed after uninstall.
View 8 Replies
View Related
Jul 2, 2010
I'd like to maintain a hash table in a broadcast receiver. If I understand BroadcastReceiver's life cycle currently it could get killed wiping out my member variables. What would be the ideal strategy for retrieving a hash table from a previous run of onReceive in the BroadcastReceiver?
View 3 Replies
View Related
Oct 10, 2010
Messing around on AppBrain I found a new game, Spaghetti Marshmallows. The idea is to build structures out of marshmallows and spaghetti noodles, to reach given points on the screen. What seems to be a very simple game on the surface, actually requires a very strategic planned out execution.
View 15 Replies
View Related
Dec 21, 2009
How do I save info. So new to pda and love my eris but some reason I was in below freezing weather and screen timed out then a bunch of lines came on phone and wont go away. V is sending me a new phone since I have only had it 2 weeks so no worries there.
My question is will have to enter all my calender info, contacts, pics and apps I installed all over again or is there away I can save all of that info. I have videos music etc., also on it.
View 4 Replies
View Related
Jul 30, 2010
I am using the getExternalFilesDir(null) method to save to the SD card. Saving and reading from the SD card is fine. The problem I am having is that every time I edit anything in Eclipse and rerun the app the data on the SD card is deleted. I know that saving to the directory returned by getExternalFilesDir(null) will allow the files there to be deleted when my app is uninstalled but is there a way to turn it off for just app updating? Is this only cause I am doing it from Eclipse and it won't delete the data when the app is updated from the market?
View 3 Replies
View Related
Apr 13, 2010
webview caputured data get lost while save in a thread.
CODE:...............
View 2 Replies
View Related
Nov 5, 2010
We've been developing an Android app at work for a few months now and recently acquired Droid Incredibles (API ver. 8) to replace our HTC Dev Phones (API ver. 4).
DANG are these some sweet new toys, but unsurprisingly, they've got a few quirks...
1) It's normal for my user to let the program run for long periods without any input, but he'd still need the display to work the entire time. Can anybody suggest a function call or setting or something that will prevent the Incredible's screen from dimming while my application is running??
2) On the Dev phone, I was able to copy my application's database file (thousands of uses, that) onto the SD card's root directory and fly. I could view the directory on my PC via USB; when I released the SD card from the PC, my application was perfectly happy with it and obediently read from and wrote to the database; and I didn't have to remove the SD card, ever. That doesn't seem to be the case with the newer, better phone, though. My application seems to be reading my start up parameters properly, but all attempts to save data in my database aren't working so well unless I'm just doing something wrong. Can anybody point me to documentation specifically geared toward the Incredible?
View 2 Replies
View Related
Oct 30, 2011
Not possible with Ice Cream Sandwich 4.0.4. The only way is to use Titanium Backup, and better than that, Nandroid Backup. You can as well extract data from a Nandroid backup with Titanium Backup.
I have a Nexus S and I wonder if, with the option Settings -> Accounts and sync -> Background data & Auto-sync & Manage accounts (sync is on) the settings and savegames are automatically stored "on the cloud", let it be my Google account or similar, because I don't have a rooted phone and don't want to do that to preserve warranty.
So, the apps for wich I want to save data are:
Air Penguin
Angry Birds
Angry Birds Rio
Angry Birds Seasons
ArmySniper
Clouds & Sheep
Dolphin Browser HD
eBay
EGGGZ
Flight Director
Jewellust
Jewellust Xmas
Labyrinth
MultiGrain
X Construct
View 7 Replies
View Related
Nov 26, 2009
My app is made of two activities, A and B. I'm considering this sequence of steps: Activity A is started. A launches B [A is paused, B is running]. B launches a map intent [A and B are both paused now]. Now the user is using the maps application and the system decides it needs more memory. Can the system kill only one of my activities for memory, or will it always kill all activities in a "process" in this situation?
Both activities share some static data like:
class Data {
public static String mName;
public void save() {
// write to file: mName;...................
View 1 Replies
View Related
Nov 24, 2010
It would be nice if StackOverflow had a section where we could post tutorials like mine so that I can answer literally hundreds of questions that have been asked here with a single blow. See... every day I read questions about how to pass complex objects between activities, how to save state so that your app can resume after orientation change, how to update listviews when the data changes, etc, etc. Here is the second part of a tutorial series I posted on my blog... I hope that you actually read it... because I haven't seen any examples like it anywhere... and it has changed how I think about developing for Android across the board. The question is... is there a downside or negative affect of developing like this?
Beyond Smart Lists - How Observable Singletons change the game. Please read through both of these tutorials carefully... I will answer any questions about it here that I can... I really want to know what you think about this and if it might solve issues for you. NOTE TO MODERATORS: there are no advertisements of any kind on my blog.. so don't just close this because you think I am spamming somehow... I am not going to duplicate my post here.
View 1 Replies
View Related
Aug 16, 2010
I want to save the data on the web server. I have data in XML format and I know the URL String. Please tell me how can I send the request and handle the response.
View 1 Replies
View Related
Mar 16, 2009
I'd been using my own Camera class for taking images and my own database but soon enough I couldn't really keep up with changes and I decided to use the built in camera application in Android to do the job, but I can't seem to get it to save file. What am I missing here? The application seems to save the file but it's just 0 bytes. I looked up the source code of the Camera application and it's looking for the "output" in Extras to save the file.
Public class CameraTest extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);...............
View 5 Replies
View Related
Oct 5, 2010
I have an app that only requires the value of a textview field to be saved... what would be the most simple and efficient way to save such a small amount of data? Creating a database for this seems like overkill. would onSaveInstanceState be sufficient?
View 4 Replies
View Related
Feb 26, 2010
I want to cache google maps, and put them into the memory, using sqlite DB,so that I don't have to always use the internet connection! is that possible? and if it is possible I would like to know how?
View 1 Replies
View Related
Oct 23, 2010
I would like to be able to save& view the data from 3 edit text fields and a date pick to an SQL lite DB. Can anybody point me to a decent beginners tutorial or perhaps give me an idea of where to start?
View 2 Replies
View Related
Oct 11, 2010
i want to know how to save user Data in android so i can retrieve it when staring and during the run of the application
View 3 Replies
View Related
May 2, 2012
I've been developping an app and I need to save internal data.Here is what I have;
Code:
private void ChkFile() {
file = getBaseContext().getFileStreamPath(filename);
String text;[code].....
View 4 Replies
View Related
Nov 2, 2012
Is there any way to save all if my app data and settings?
View 10 Replies
View Related
May 23, 2014
I have an LG Optimus Showtime (android vers 4.0.4). Im wondering if there is a way to disable data use by a single app? I uninstalled Flickr app because it used up so much data. I would like to re install it again but only if there is a way to disable data when Im not using it. The only thing I see is to go into system settings, data usage, and then either go to a specific app and Restrict background data or Turn Off mobile data. The past few weeks I have been turning off mobile data when not using. I have went into some of my apps settings and unchecked notifications, etc., but that doesnt seem to really save data.
View 3 Replies
View Related
Apr 1, 2014
I have an app that consites of a screen with 6 tabs. Each has 3 edit texts boxes for your subject, date due and details of the homework (for my school homewrok timetable app). I want to know how i can save the texts in the edit texts boxes after i have entered it and then left that screen or went off the app. I know you need shared preferences as i did it for another screen but as its a tab screen i dont know where to put it. p.s i used the mothod of homework.java (main), homeowork.xml and finally tabs.xml.
View 3 Replies
View Related
Jan 2, 2014
How do I save data to the external SD card? I would like music, pictures and apps to be stores at the SD card (32 GB) and not on the "normal" internal storage. My phone is a Samsund Galaxy Trend.
View 3 Replies
View Related
Mar 31, 2013
Just have a quick question regarding the data on my phone. I am selling my phone tomorrow and I have a LOT of data on it which I need to transfer.
These are the things I wish to transfer-
-Contacts
-Old Messages and draft messages
-WiFi passwords
-Apps(lol obviously)
-App data
-Call logs
-Any other important things which I may have missed out.
I'm going to transfer my songs and videos manually via connecting my USB cable to the computer, I just don't want to mess up the other bits.
How do I transfer this to this to my computer so i can transfer it to my next phone? How do I transfer it to my next phone?
Additional info- My current phone is the Sony Ericsson Xperia Neo V (rooted) running ICS 4.0.4.
My next phone is most probably the Samsung Galaxy S3(International Version) I have Titanium Backu(free Version).
View 2 Replies
View Related
Nov 15, 2011
Currently, I have a Thunderbolt, but I'm planning on buying a Galaxy Nexus whenever that becomes available. Thing is, I have a few games I'm playing, and while I know I can simply redownload the games from the market on my new phone, is there any way I can also transfer the save data? I don't want to have to start all the way at the beginning, with games like Angry Birds, Cut The Rope, Symphony of Eternity, etc.
For what it's worth, my phone is not rooted.
View 6 Replies
View Related
Dec 9, 2012
saving data usage on android.To those who use data plan on sim cards, there are plenty of apps that can monitor and reduce their data usage. ie: Onavo Extend, Opera Mobile/Mini.
But im using MiFi/portable hotspot to access the internet. Apps like Onavo seems working only in 3g mode, and not wifi.
So i cant ge maximum data savings on my MiFi plan.
Is there any apps, that can tweak android so that when i connected to my hotspot, it is detected as 3g. Basically something like that.
View 1 Replies
View Related
Sep 15, 2012
are there any android apps that can save data to files then copy to folder or sd card? for example, I want to take some notes and save to text files in notepad and save to sd card.
I found almost none of android apps can save. can any list some apps can save data ?
View 4 Replies
View Related
Nov 15, 2013
where is the save data for games. like Zombie HQ, Sniper Shooter, Zenonia 5???
I usually do a Titanium backup. but after a while the game starts acting up. i would like to know where is the data located so i could back it up my self.
Running CM10.2 GS4
View 9 Replies
View Related