[android-developers] SharedPreferences: can't keep information stored for future access

2016-01-15 Thread Pedro CLR
I was asked by my employers to developed a webview-based app. > MainActivity will just check if there's already a SharedPreferences file saved: - if true, loads the information on that file; > I also check if the URL registered in that file is an empty value (""), in which case I

Re: [android-developers] SharedPreferences: can't keep information stored for future access

2016-01-15 Thread Dawid Drozd
File.exist() On Fri, Jan 15, 2016 at 6:39 PM, Pedro CLR wrote: > I was asked by my employers to developed a webview-based app. > > > MainActivity will just check if there's already a SharedPreferences file > saved: > - if true, loads the information on that file; >

Re: [android-developers] SharedPreferences: can't keep information stored for future access

2016-01-15 Thread Pedro CLR
thanks, the problem was the path I entered to get to the file I was checking :) once again thanks for the efficiency and the fast answering :) thank you so much for you help On Fri, Jan 15, 2016 at 6:59 PM Dawid Drozd wrote: > File.exist() > > On Fri, Jan 15, 2016 at

[android-developers] SharedPreferences doesn't work for my app but other apps is ok.

2015-12-21 Thread Cihan KALOĞLU
Hi, I tried all ways how many i know. That is my code block for test. (MainActivity.onCreate()) String REMEMBERME_PREF_NAME = "rememberme"; SharedPreferences sharedpreferences = this.getSharedPreferences(REMEMBERME_PREF_NAME, Context.MODE_PRIVATE); if (sharedpreferences.getString("email",

[android-developers] SharedPreferences no work

2012-12-13 Thread Antonis Kanaris
Hello.I make an apk with two activities and use SharedPreferences for store user values but no workthis is my code...Need something extra to manifest for work SharedPreferences? public class MainActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) {

[android-developers] SharedPreferences clarification

2012-07-31 Thread Sergio Panico
Hi all, I need your help to have a clarification for the preferences framework of Android. Accordingly to Google API Reference (http://developer.android.com/reference/android/preference/PreferenceActivity.html) I created my app preferences section by extending the PreferenceActivity class

Re: [android-developers] SharedPreferences clarification

2012-07-31 Thread Mark Murphy
On Tue, Jul 31, 2012 at 9:55 AM, Sergio Panico sergio.pan...@gmail.com wrote: 1. Google API documentation talks about 2 styles for creating preference sections of an app: one deprecated old style, and one newest technique fragment-based. As per my understanding, with the first old method, all

[android-developers] SharedPreferences

2012-03-08 Thread Alejandro Alves
Hello, I want to have some preferences stored forever by my application, for example username, remember me, etc...and other preferences to be stored only until the application is closed, or the user logs out. So basically my question is how do I delcare which preferences must be stored for ever,

Re: [android-developers] SharedPreferences

2012-03-08 Thread Mark Murphy
The stuff that should be cleared when the application is closed by the OS are not preferences, so do not implement them as such. Use static data members or something along those lines, so they will go away automatically when Android terminates the process. On Tue, Mar 6, 2012 at 10:00 AM,

[android-developers] SharedPreferences variable question

2011-12-17 Thread Larry/MavrickProductions
I need to read a year variable to set a timer. I'm using shared preferences to store the variable so it is available across the whole app. At the completion of the timer, the year variable is advanced by one and writes back to the shared preferences. I have chased and checked and the year variable

Re: [android-developers] SharedPreferences variable question

2011-12-17 Thread TreKing
On Sat, Dec 17, 2011 at 11:22 PM, Larry/MavrickProductions ohiooutofdo...@gmail.com wrote: SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); SharedPreferences myPrefs = this.getSharedPreferences(settings, MODE_PRIVATE); final SharedPreferences.Editor prefsEditor

Re: [android-developers] SharedPreferences question

2011-11-16 Thread Kostya Vasilyev
Are you trying to let the user change the value with a preference activity, and still get access to the value from code? If so, make sure that the shared prefs storage is the same in both cases: Option 1: - In your code snippet, call PreferenceManager.getDefaultSharedPreferences() rather than

[android-developers] SharedPreferences question

2011-11-15 Thread Larry/MavrickProductions
I have a need to store a single value - the year - so that it can be called from any activity in my app. Shared Preferences seems to be the easiest but I've got myself coded into a wall and could use a spot of advice. I think the problem is in my XML, but I'm not sure. Here's the pertinent snip

[android-developers] SharedPreferences update issue

2011-07-17 Thread mark2011
Dear All : I had use getSharedPreferences, edit, putString commit to save the setting in activity A successfully. I start another Activity B from Activity A. I can display the setting on the Activity A. I also use the same command to update the setting on the Activity B (

Re: [android-developers] SharedPreferences update issue

2011-07-17 Thread TreKing
On Sun, Jul 17, 2011 at 10:45 PM, mark2011 androidmark2...@gmail.comwrote: What's wrong ? Can anyone help me? Without the actual relevant code to look at, I'm not sure how much help you're going to get.

Re: [android-developers] sharedpreferences and http post , give back force close ... where's the problem ?:(

2011-04-10 Thread TreKing
On Sat, Apr 9, 2011 at 2:51 PM, behrooz abbasy behrooz.abb...@gmail.comwrote: what should i do? :( Debug your program. - TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago transit

[android-developers] SharedPreferences not persisting

2010-12-18 Thread neuromit
I've been trying to save some state variables in the SharedPrefs, this seems to work fine when onPause, and onStop are called but not when OnDestroy() is called. When that happens the next time my activity loads the preference values have disappeared. Here is the code I use to save the variables:

Re: [android-developers] SharedPreferences not persisting

2010-12-18 Thread Mark Murphy
Generally, I recommend PreferenceManager.getDefaultSharedPreferences() to get the SharedPreferences, as that will be the one that PreferenceActivity uses. Otherwise, your code seems fine. However, bear in mind that onDestroy() is not guaranteed to be called, so you may be better served writing

Re: [android-developers] SharedPreferences not persisting

2010-12-18 Thread Dianne Hackborn
If you want to ensure the data is saved, it must be done in onPause(). Under low memory situations, an activity can be killed before its onStop() is called. On Sat, Dec 18, 2010 at 2:07 PM, Mark Murphy mmur...@commonsware.comwrote: Generally, I recommend

[android-developers] SharedPreferences are not stored

2010-11-22 Thread Claudio M. Camacho
Hello everybody, This is my first question. I tried to ask in android-beginners, but the group is discontinued. My problem is using SharedPreferences. I just created a PreferenceScreen which holds inside a ListPreference with an array of 5 different values. Very simple! The array of values are

[android-developers] SharedPreferences can not create the xml file

2010-02-01 Thread Shahin
Hi I have been trying to fix this problem for 3 days now and still no luck. I am trying to save some preferences of my app (just a few integers and strings), but I notice that SharedPreferences never creates any xml file. So far I have tried the followings: 1) In my AndroidManifest, I set

[android-developers] sharedpreferences widget

2009-06-09 Thread RS
I have a few questions on the default home screen's widget support: 1) if there are multiple instances of the same widget how to differentiate each (so that the content could be different) eg. world clock: same clock widget for different countries on diffferent screen. 2) is there any

[android-developers] SharedPreferences bug when writing strings with ampersands in them

2009-03-06 Thread cmgreen...@googlemail.com
Hi All, I've just tracked down a weird bug in our app where SharedPreferences were failing between power cycles of the phone. It turns out that one of the strings we were saving had an in it. When I look at the xml that is being persisted I see that this is being encoded as amp; instead of

[android-developers] SharedPreferences - is it secure?

2009-02-07 Thread Teo
Hi, i'm implementing a feature that requires a password, is it safe to store using SharedPreferences.Editor? Is there another recommended way for storing passwords? Thanks, Teo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[android-developers] SharedPreferences getting lost on device power off / on

2009-01-19 Thread Ryan
Hi, I'm finding if I save pref's and then turn my G1 off and back on, they have been erased. Is that the expected behaviour? I've seen similar reports from a search, but cannot find a solution. My code to save and restore is as follows:- public void save() { SharedPreferences

[android-developers] SharedPreferences problem

2008-11-18 Thread Eric B
I have a PreferenceActivity that uses an xml file to automatically populate and save the preferences. Sometimes though, when that activity is started, the preferences are blank. However, if you go back later, they will reappear. This is causing a lot of headaches with my app. I have a Service

[android-developers] SharedPreferences are getting erased

2008-11-18 Thread dar
I'm on RC30, and I have not seen this issue first hand, but some of my users are reporting that my app is losing its SharedPreferences after about an hour, or some other unspecified time. They say they are not uninstalling the application. The only way I have seen the SharedPreferences be

[android-developers] SharedPreferences: editor.commit() always false even though it commits

2008-11-04 Thread polo777
Hi everyone, Almost everything is in the title. I am trying to save username and password into the sharedpreferences file. I used the little function below to do so: Everything works (The data are written correctly, I can read them afterward) but the editor.commit() always returns false even

[android-developers] SharedPreferences vs Database, when to use which?

2008-06-12 Thread Danny
I made a simple login page, I pretty much regurgitated the Forwarding example in the API Demo. In addition, I added a Remember Me check box, which I promptly stored in a SharedPreference as boolean. I did some digging in the File Explorer, and found I could extract that XML file. Would I be