Thursday, 17 September 2015

imp notes

can the sound recorder keep on recoding sound even if  i turn the screen off?

can recording be done even if i swtich to different activity or app?

can recoring be made  a android service?


in the app made by asus all the three things are working , i dont know whether its a service or not but its working even in different screen , different app and with screen offf.


android theme set up part is done in manifest for each activity


in a list for xml we can set its value from xml its self and that can be done using
android:entries="@arrays/list"
no number of list items will be equal to the number of elements in the array
and they can have their entryvalues also which will not be shown but can extracted for the use
android:entryvalues="arrays/lValues"

Now even if a preference activity class has a listactivity we will not extend it with list activity but will extend it with (extends PreferenceActivity)
To addPreference from xml we just use addPreferenceFromResource(R.xml....)


to exit application just use finish() function



To get the value of preference that is there , we need to use PreferenceManager,
actually something like this

SharedPreferences sps=PreferenceManager.getDefaultSharedPreferences(getBaseContext());
Now to check value using this sps
for example we are checking the checkbox thing
boolean b=sps.getBoolean(key,defvalue); // now in the xml checkbox declaration we had given it a key to get identified, and defvalue as true
 

No comments:

Post a Comment