Android :: Persist File When App Closes
Jun 14, 2010
I am creating a file in my Android application as follows:
code:..........
And I write to the file during the running of the app as follows:
code:..............
This works fine but when my app closes the file gets deleted and when the app is run again all the information I wrote to it is gone.
How can I make sure the file persists even after closure of the app?
Update:I have changed MODE_PRIVATE to MODE_APPEND and the problem is fixed.
View 1 Replies
Apr 14, 2013
I have this problem with my friends galaxy ace GT-S5839i: here because I don't know what to do I pulled the file framework-res.apk from system and then changed the extension to zip, and changed an image inside one of the folders.
After that I zipped the pack again (tried several zip options) and changed the extension back to apk My first question: Is this ok?
I copied the changed file to sdcard and using es explorer moved the file to system/framework. Imediately After answering if I wanted to overwrite the phone freezes and never booted again.
I restored the rom and tried several times with same result I tought the problem would be trying to overwrite a file that's in use but then I found a tool the decompiled the original apk, changed the image, compiled and signed it and made a flashable zip of it.
It gsve always error in trying to flash this on recovery so I extrated the compiled and signed new framwork apk and moved it to system with es explorer... The difference now is that it didn't froze the phone but started to show fc's everywhere. Rebooted, wipede cash and dalvik, messed up woth permissions... Everything I could think of and the result os always tbe same...
View 4 Replies
View Related
Jul 27, 2009
I'm well aware of onSaveInstanceState(Bundle b) and the corresponding onCreate and onRestore. What I want to do is persist the bundle somewhere simple where I'll only ever have one at a time. The functionality is to be able to resume a game from its previously stored state - not to be confused with restoring the activity during its lifecycle. I want to restore it AFTER it's been destroyed (think of turning the phone on and having a button on the game that says, "resume last game". My thoughts are that if I can just persist the bundle that I normally use for the instance state, then I should be able to reload it later upon user request. I don't want to use a provider because they seem way too over the top for what I'm doing.
View 4 Replies
View Related
Jun 3, 2010
My app schedules an alarm,with the alarm scheduled, what happens if I release a new version of my app, and the user upgrades the app? Will this alarm be removed? Or will it be left untouched, and fired as expected?
View 2 Replies
View Related
May 6, 2010
I am building an app which uses a WebView. This app runs at startup. Is there a way to maintain the app running(persists) even if the user presses the 'Home' or 'Back' button? In other words,pressing the 'Home', 'Back' or the other buttons shouldn't close the activity.
View 8 Replies
View Related
Feb 16, 2009
I've been searching around and can't seem to find a way to do this properly. I am doing some tracking where I want to draw dots on a map overlay recording previous positions. When onDraw of the overlay is called it seems the canvas is cleared so I have to redraw all of the history on every invocation. This could result in several thousands of dots being draw over time which seems to not be very efficient. Is there some flag somewhere that I have not found which tells a map overlay to be persistent? Or is there some way I can save and restore the canvas so I'm only maintaining/drawing the current point on each onDraw?
View 4 Replies
View Related
Mar 16, 2010
I have a WebView. I'm not quite sure how caching works for it. Ideally I'd like to load a web page from the network once (images included), then from then on only ever load it from the local cache. I'm not sure if we have this level of control over webview. Will it at some point just auto-clear the cache? How could I tell? I need to be sure that it's really keeping the page cached between different runs of my application.http://developer.android.com/reference/android/webkit/WebSettings.html.
View 1 Replies
View Related
Jun 17, 2010
How do I make the "new email" flashing green LED continue to flash forever or until I mess with the phone? It works fine, but stops flashing after a while so if I'm not staring at my phone, I could miss the LED indicator and not realize I got a new email. Using the Gmail application (not the HTC email program).
What causes the LED to stop flashing after a while? Is it because the phone is going into a deeper sleep mode that I could configure, or is it because the flashing LED indications stop and there is nothing you can do about it? I checked under notifications and didn't see any setting for "duration" of the flashing LED indicator for emails.
View 11 Replies
View Related
Jun 7, 2010
In the description of how to add a list of options to an AlertDialog the official Android documentation alludes to saving a users preferences with one of the "data storage techniques." The examples assume the AlertDialog has been spawned within an Activity class.
In my case I've created a class that extends ItemizedOverlay. This class overrides the onTap method and uses an AlertDialog to prompt the user to make a multi-choice selection. I would like to capture and persist the selections for each OverlayItem they tap on.
The below code is the onTap method I've written. It functions as written but doesn't yet do what I'd hope. I'd like to capture and persist each selection made by the user to be used later. How do I do that? Is using an AlertDialog in this manner a good idea? Are there better options?
CODE:.......................
View 2 Replies
View Related
Jul 1, 2010
I'm developing an application that would need to persist data locally in Android devices. I'm aware that Android provides two packages for database persistence, the normal "java.sql" and the "android.database.sqlite"? Which one is used more for persistence? I suppose that "android.database.sqlite" is the implementation of "java.sql",
View 1 Replies
View Related
Oct 8, 2009
I'm getting reports from users about force closes in my app after the donut OTA. One of them was kind enough to send me a logcat which included these two gems (right after he installed it from market):
10-02 15:56:35.708 D/PackageManager(71): New package installed in / data/app/com.billnapier.android.livebookmarks.apk 10-02 15:56:35.708 W/PackageManager( 71): Unknown permission com.android.browser.permission.READ_HISTORY_BOOKMARKS in package com.billnapier.android.livebookmarks 10-02 15:56:35.708 W/PackageManager( 71): Unknown permission android.permission.READ_HISTORY_BOOKMARKS in package com.billnapier.android.livebookmarks
The second one makes sense, since that name has gone away. But I can't figure out why the first one would show up, since that permission should exist on the phone. anybody got any clues? I can't reproduce this on my phone, so it's kinda hard to debug.
View 2 Replies
View Related
Nov 24, 2009
Some of my users are reporting force closes. Does anyone have some ideas about how to track these issues down when I can't reproduce them in the Emulator or on my Hero? This is my app btw if anyone wants to logcat it for me:
http://aliceonandroid.wordpress.com/
View 5 Replies
View Related
Mar 31, 2014
When i click button "Add profile picture" it goes onto gallery as it should but once i click a picrture it collapse and the app closes, why is this? I have an image view that is what is goes on?
Quote:
package com.example.timetable;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;[code]....
View 15 Replies
View Related
Sep 12, 2010
I am new to android development and I have made this using help from a website. The XML files dont have any errors,Here is my Main java code: package com.CFConverter;
import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.os.Bundle; import android.os.Message; import android.view.View; import android.view.View.OnClickListener; import android.widget.EditText; import android.widget.RadioButton; import android.widget.Toast;
public class CFConverter extends Activity {
/** Called when the activity is first created. */ private EditText text;
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
text = (EditText) findViewById(R.id.EditText01);
} //This Handler is called when we click the button01.
public void myClickHandler(View view) //passing the current view {
if(view.getId()== R.id.Button01) {
RadioButton celsiusButton = (RadioButton)findViewById(R.id.RadioButton01);
RadioButton farhrenheitButton = (RadioButton)findViewById(R.id.RadioButton02);
if(text.getText().length()==0) { Toast.makeText(this, "Please Enter a Valid Number", Toast.LENGTH_LONG);
return; } float inputValue = Float.parseFloat(text.getText().toString());
if(celsiusButton.isChecked()) { text.setText(String.valueOf(convertCToF(inputValue)));
// calling function to convert } else {
text.setText(String.valueOf(convertFToC(inputValue)));
} return; } } private float convertCToF(float fahrenheit) {
return ((fahrenheit - 32) * 5 / 9);
} private float convertFToC(float celsius) {
return ((celsius * 9) / 5) + 32;
} }
View 3 Replies
View Related
Sep 11, 2009
We have had a couple users on the myTouch phone have issues in our application. It apparently is force closing on them. I am not sure of why it is, and the 1.6 SDK is not out yet. Has 1.6 been released into the wild? If so, do you know where I can download the image for my G1 dev phone to test w/?
View 7 Replies
View Related
Aug 9, 2010
I have a Driod Ally that is less than 2 months old.
This is the problem I am experiencing: Whenever I open an email from my second account, the Corporate Email account, the email I'm reading won't stay open. Sometimes the email closes immediately, sometimes it closes after a minute, but it always closes. I don't have time to read it, let alone reply to it. Also, if I'm in the inbox, it will close and goes back to the Home screen. All of this happens randomly.
My Gmail account has no problem staying open. In fact, none of my other apps share this problem, it only happens to my corporate email account which happens to be the most important aspect of the phone.
I tried nuking the account and re-establishing it- to no avail.
View 2 Replies
View Related
Jan 20, 2010
I have the Motorola droid. I can see my inbox but when I try and open an email the app force closes. Anyone else had this problem?
View 1 Replies
View Related
Aug 1, 2010
I have a Service with a MediaPlayer which streams audio from the Internet but when I press the Home button and it goes back to the home screen it Force Closes. It's strange though because it works perfectly in the emulator and sometimes it doesn't Force Close on my phone (G1), when I've just turned it on.
This is my code:
CODE:............
Log:
CODE:....................
View 1 Replies
View Related
Sep 15, 2010
I have an application that shows a textview occupying most of the screen. When the user clicks on a portion of the textview I want to find the closest character to where they clicked so I can show them information about that part of the text in detail. I have the OnTouchListener and I can get the x,y of the click but does anyone have any idea how I can use that to get the closest character in the textview?
View 1 Replies
View Related
Jul 5, 2010
Would anyone have an idea as to why an app would work on almost every phone that has 2.1 but not the Desire?
One of my apps uses voice input and the Desire is the only phone that force closes when the voice prompt comes up.
The worst part is that I don't know how to test this, I don't have one or know anyone who does.
I finally found out that HTC disabled voice in the Desire and you have to do a work around to install it.
So if you are relying on voice input make sure you use the code in the google example to catch the error:
CODE:......................
View 1 Replies
View Related
Nov 23, 2010
My mother is having this random problem where her web browser closes, sends her back to the Google search page. It seems to only happen when she has some tabs open. Note that it does not force close it just crashes. She is very disappointed and would like to know the solution. My evo sometimes send me to the home screen but does not close.
View 1 Replies
View Related
Sep 13, 2010
I'm attempting Google University Android lab1 you are asked to change a TextView's text content according to the value passed via the Intent from another activity.
I tried out the rest of my code but...why does my app force close when I add the "tv.settext(...) line"?
CODE:...................
View 1 Replies
View Related
Nov 4, 2010
My app works when GPS is disabled, but FC's when starting while GPS is enabled. On a cold start it offers the option to turn on the GPS. After doing that, pressing the back arrow button it returns to the app activity (although the GPS icon is not visible in the status bar, on a side note, how do I get it to display here?).
I exit the application by pressing the back button or using the menu option whilst GPS is still on.
Now, when I try to start the app, it FC's. The blinking GPS icon appears behind the FC message and disappears when I acknowledge the FC.
Here is the code:
CODE:........
And this is the logcat from eclipse:
CODE:........................
View 1 Replies
View Related
Mar 31, 2010
I am trying to display the image on the ImageView object. But the setImageResource fails to display the image. Here is my XML file looks like:
<?xml version=*"1.0"* encoding=*"utf-8"*?>
<LinearLayout xmlns:android=*"http://schemas.android.com/apk/res/android" *
android:orientation=*"vertical" *
android:layout_width=*"fill_parent" *
android:layout_height=*"fill_parent"*>
<FrameLayout
android:orientation=*"vertical" *
android:layout_width=*"fill_parent" *
android:layout_height=*"fill_parent" *
android:layout_weight=*"1"*>
<ImageView
id=*"@+id/batteryLevelview"*
android:layout_width=*"wrap_content"*
android:layout_height=*"wrap_content"*
android:layout_gravity=*"center"*/>
</FrameLayout>
</LinearLayout>
Here is my code:
@Override
*public* *void* onCreate(Bundle savedInstanceState) {
*super*.onCreate(savedInstanceState);
setContentView(R.layout.*main*);
ImageView batteryLevelImage = (ImageView) findViewById(R.id.* batteryLevelview*);
batteryLevelImage.setImageResource(R.drawable.*notconnected*);
}
View 7 Replies
View Related
Dec 23, 2009
I am a brand new developer to Android. I wrote a pretty simple application that uses the gesture library. The application itself seems to run fine in the simulator. However, when I installed the application on my Google Dev Phone 1 (G1) last night, it doesn't seem to work. I've upgraded my G1 with the 1.6 image from the htc developer site. I see the first screen/activity for about a second and the application exits without and errors. Here is what my manifest looks like:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.blahblah" android:debuggable="true"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="4" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_CONTACTS">
</ uses-permission>
<uses-permission android:name="android.permission.CALL_PHONE">
</uses- permission>
<application android:icon="@drawable/icon" android:label="@string/ application_name"> <activity android:name="Gesture1Activity"
android:label="@string/application_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="Gesture2Activity"
android:label="@string/label_gesture_list" />
<activity android:name="Gesture3Activity"
android:label="@string/label_create_gesture" />
</application>
</manifest>
Here's the output for logcat:
D/AndroidRuntime(860): D/AndroidRuntime(860): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<< D/AndroidRuntime(860): CheckJNI is OFF D/AndroidRuntime(860): --- registering native functions --- I/jdwp (860): received file descriptor 20 from ADB D/ddm-heap(860): Got feature list request I/ActivityManager(101): Starting activity: Intent { flg=0x10000000 cmp=com.blahblah/.Gesture1Activity } D/AndroidRuntime(860): Shutting down VM D/dalvikvm(860): DestroyJavaVM waiting for non-daemon threads to exit E/AndroidRuntime(860): ERROR: thread attach failed D/dalvikvm(860): DestroyJavaVM shutting VM down D/dalvikvm(860): HeapWorker thread shutting down D/dalvikvm(860): HeapWorker thread has shut down D/jdwp (860): JDWP shutting down net... D/jdwp (860): +++ peer disconnected I/dalvikvm(860): Debugger has detached; object registry had 1 entries D/dalvikvm(860): VM cleaning up D/dalvikvm(860): LinearAlloc 0x0 used 677572 of 4194304 (16%) W/InputManagerService(101): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub $Proxy@439a9eb8
View 5 Replies
View Related
Jul 12, 2010
I've a very simple / minimal code application.
I'm drawing some lines on screen with my finger.
At some point, app closes itself / exists automatically.
No exception is thrown.
CODE:......................
View 3 Replies
View Related
Oct 15, 2009
I spent a month stocking my SugarSync folder full of files and entertainment for my big vacation. On day one of my trip the Donut 1.6 update came through and now SugarSync force closes constantly, haven't been able to use it since. I've been emailing the developers and they refuse to see a connection (despite several comments in the Market of other users blaming 1.6). Is there a chance it isn't 1.6 and how can I fix this? I've uninstalled and reinstalled several times with no improvement. It was an awesome app when it worked, I'll be damn sorry to have to delete it.
View 4 Replies
View Related
Nov 18, 2010
I've implemented a ContextMenu where the items have checkboxes enabled via setCheckable(true). What seems strange to me is that the context menu closes as soon as I click the checkbox. These are not set up as radio buttons (implying single selection) and since the nature of checkboxes are to allow multiple selection, I'm unsure of how to prevent the context menu from closes when the checkbox is clicked. Am I overlooking some property?
View 2 Replies
View Related
Nov 3, 2010
Im wanting to stop all threads when my main activity closes as some are still running afterwards and are giving NullPointerException as they try to access Array Lists which no longer exist. however none of the obvious methods are working and they are also deprecated. is it possible as im currently using a try/catch statement as a workaround but would prefer a fix.
View 1 Replies
View Related
Jun 15, 2010
I'm having an issue linking my wife to her Facebook profile in the contact "people." When she calls her number comes up. After I hang up, I try to "connect with person already in contacts" and it forces "People" to close. I tried to add her manually and it deleted it before my very eyes while I was within "people." I did it using the Google phonebook and not the phone's. Is there any issue with this, and what's the difference between the Google and Phone options (benefits, etc... ?).
View 3 Replies
View Related