[Q] Add changelog/info pop-up at app start? - Android Software Development

Hello! i have started making an app for android, and im really really a beginner. however, i got the app working (its a soundboard) but i would like a info screen to pop up when you start the app. i think its really easy to do, but i totally have no idea of how to doing it... can someone please help me?

bump... can someone help me quick with this minimal problem...

OK, this should be pretty simple.
Create a boolean value in the shared preferences, let's call it firstRun. In onCreate() you will check whether this value exists in the preferences. If it does not (or if it's set to true), you know it's the first run and you can show a dialog and set the value to false. If the value exists and is set to false (once you access the value for the first time it will automatically be created in the preferences), then you won't show anything as it is not the first run.
Showing a changelog is just an extension of this process.

Related

Quastion about Windows Mobile Registry. Need Help

I need programmatically change Profiles in phone (Normal, Silent...).
When I change Value ActiveProfile in Registry Key "HKEY_CURRENT_USER\ControlPanel\Profiles" I need also update changes in phone.
Question: How can I do it? What system message I must send for updating profiles status?
2007fs said:
I need programmatically change Profiles in phone (Normal, Silent...).
When I change Value ActiveProfile in Registry Key "HKEY_CURRENT_USER\ControlPanel\Profiles" I need also update changes in phone.
Question: How can I do it? What system message I must send for updating profiles status?
Click to expand...
Click to collapse
Depends what you need to do, in general there is a Windows Meesage WM_SETTINGCHANGE that will notify the change (provided that you flush the registry), however to me it looks like you are "hacking" the registry instead of using a more appropiate method, I never changed a profile, but I done some similar things, did you try something like the API SystemParametersInfo?
For example I must change Profile from Normal to Silent and after changing at the same time must automatically turn off the phone sound and on desktop must show non-sound icon.
I have try a sending message WM_SETTINGCHANGE, but I have no effect, may be I not correctly used command SendMessage.
API SystemParametersInfo and other I didn't try. May be you have any expirience in this?
As far as possible, write please some example to solve my problem
Take a look here:
http://groups.google.com/group/micr...rofile+registry&rnum=1&hl=en#b3a56f92d65fee2d
There are not good news, you either try to simulate a key stroke to change the profile or try to feed it or try to work out if DMProcessConfigXml function will make the trick by feeding the XML with the profile configuration.
It doesn't seem to be other workout, for the DMProcessConfigXml function is plenty of information and examples @ msdn.microsoft.com.
Hey!
I used this code and it helped me
HWND hWnd = FindWindow(_T("MSCprog"),NULL);
::SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0);
::SendMessage(HWND_BROADCAST, WM_NOTIFY, 0, 0);
::SendMessage(HWND_BROADCAST, WM_USER+0x3084,0xFFFFFFFF,2);
if (hWnd!=NULL)
{
::SendMessage(hWnd, WM_USER+0x3084,0xFFFFFFFF,2);
::SendMessage(hWnd, WM_USER+0x3084,0xFFFFFFFF,2);
::SendMessage(hWnd, WM_USER+0x3084,0xFFFFFFFF,2);
}
don't worry and be happy, as I am
On the HTC Touch pro 2 in the settings somewhere I tapped commit registry and it said registry flushed. Since I have nothing on my phone really just yet I feel like doing a hard reset after pressing that button.
What does it do? Should I hard reset or not? Is it safe?
Does it change anything in the phone? Does/ can it make the phone run slower (after time maybe, or better?)? Can it make the phone have problems and flaws along with bad performance and instability; can it make the phone not stable? Can it change a certain program or make it worse? How often is the registry to be flushed?

[SOLVED 17-12-2009]Possible to switch position of shortcuts, or delete and add again?

Hii guys,
I was wondering if it is possible to switch the possition of the shortcuts, or do you have to remove everything and add them back again?? I couldn't find it so quickly in any other thread.
Thanks in advance
The Solution is to be found in post 6 + instructions!! Thanks to Som03ne!!!
==================================================
Here is a small app to re-order the Sense shortcuts.
Its GUI is very simple using existing controls/components, since I did not have too much time to put in it - resulting not much gui control modifications, meaning - Up - means up in the list -> down in the display.
Or to put it short - Clicking UP moves the element down, and clicking DOWN moves the element up.
On exit - you can select either to apply the changes, or drop the changes.
For changes to take effect - you should Power Off and Power On the device
(Or any other way to cause Sense to Exit and Re-Load)
I tried it on my device and it works.
Any comments - post in this thread, and Id check for them every now and then.
===================================================
There is . . . but
Filipek88 said:
Hii guys,
I was wondering if it is possible to switch the possition of the shortcuts, or do you have to remove everything and add them back again?? I couldn't find it so quickly in any other thread.
Thanks in advance
Click to expand...
Click to collapse
You can do it with registry editor
HKLM\Software\HTC\Manila
There are keys marked with 0..9 (or 0..n)
each item is a shortcut on the home page.
Just change the numbers to the order you like.
If you want the 3rd element to be the first -
You should do the following:
rename "0" to "XXX"
rename "2" to "0"
rename "XXX" from the previous step to "2"
Enjoy.
OK thank you for the fast response, but is there no easier/faster way for this??
if not: then I'll do it with this
I have not found any
Filipek88 said:
OK thank you for the fast response, but is there no easier/faster way for this??
if not: then I'll do it with this
Click to expand...
Click to collapse
Maybe there is, but I tried to look for something easier,
and did not find anything.
(I believe it is possible to write a small app to do it,
but I dont know when I'd have the time to do it)
OK, well if you ever make something like that, send me a PM and I will post a link to your topic where you'll post the application, in my first post, so people who will search for this answer and come in this topic will find it.
Enjoy
Filipek88 said:
OK, well if you ever make something like that, send me a PM and I will post a link to your topic where you'll post the application, in my first post, so people who will search for this answer and come in this topic will find it.
Click to expand...
Click to collapse
Here is a small app to re-order the Sense shortcuts.
Its GUI is very simple using existing controls/components, since I did not have too much time to put in it - resulting not much gui control modifications, meaning - Up - means up in the list -> down in the display.
Or to put it short - Clicking UP moves the element down, and clicking DOWN moves the element up.
On exit - you can select either to apply the changes, or drop the changes.
For changes to take effect - you should Power Off and Power On the device
(Or any other way to cause Sense to Exit and Re-Load)
I tried it on my device and it works.
Any comments - post in this thread, and Id check for them every now and then.
This worked! Thanks. You just need to produce a Sense UI version. THis is especially useful if you have 16 links instead of the standard 9.
Wouldnt it be nice if you could reorder apps like on the iPhone? Not functionally necessary, but nice to look at nonetheless
Thanks again.

List of unsolved registery tweaks. Need help.

Ok a lot of fun can be discovered from changing registry entries and seeing what they can do. Here is a small guide:
If an entry has a 0 it means it is disabled or off. If it has a 1 it means it is enabled or on.
Remember and make a note of any change you make in case you need to put it back.
Search for common words in the entries and see what they relate to and if they can be changed Eg:
disable, enable, show, hide, lsk, sms, boost, cache, icon etc. Go through each one. Make any changes you want based on logic of the entry and reset maybe. Go to the app where you would expect to see the change and see if your tweak has worked. If not change the reg back again.
Report back here any discoveries or potential discoveries you come across and maybe we can give advice on what should be changed in the reg entry.
Be in the frame of mind you may need to do a hard reset as a last resort so back up PIM first.
I will make a list of new potential tweaks soon and maybe someone could advise on how we can change it. Any changes found will be added to the hints and tips thread.
Here are a few to get started. Please respond with ideas if you can help and submit your own findings too.
1. HKCU\Software\HTC\WebSnapShot
Enabled currently set to 0.
Which app would use this if we enabled it?
2. HKLM\Drivers\BuitIn\GSensor
EnableShaking currently set to 0.
Sounds useful somewhere.
3. HKLM\Services\MyPhoneService
IsEnabled currently set to 1.
If we disable this if we don't use MyPhone will this free up some services/resources/memory?
4. HKLM\Software\HTC\Camera\Common
DisableCapAnimation currently set to 1.
I presume this means some sort of caputre animation when taking a photo (like the iphone when the iris closes). I tried setting this to 0 to enable it but saw no animation when I took the photo. Maybe something else needs to be done.
5. HKLM\Software\HTC\HTCMessaging
DisableCacheWhenLengthierMessage currently set to 1.
This mean cache is off with long sms messages. If we turned on cache would this be good?
6. HKLM\Software\HTC\HTCMessaging
ManilaEntry currently set to 0.
I set this to 1 but could not find any change. Maybe I am looking in the wrong place.
7. HKLM\Software\HTC\HTCSettings_Improvement
HavePersonalSecurity currently set to 0.
I have set this to 1 and a new option suddenly appears in the Manila Settings tab below About Phone option. It is ABPS, ISP, network location service (Personal Info Center). However tapping on it does not open it up. Hmmmm...
8. HKLM\Software\Tegic\T9
Prediction is currently set to 0.
I thought T9 prediction is already part of it? What could this do if we turned it on?
9. HKLM\Services\Windows Live\Plugins\Mail
Max Mail Headers currently set to 50.
Dy defualt Hotmai only downloads the last 50 messages. I tried changing this entry to 75 but no luck. Anyone else?
Anyone want to get involved? I think it could be a good challenge and we may discover a gem of a tweak.

[Research, Android 4.2] Try to enable multi user support on phones

Like we all know Google has decided that multi user support is only needed on tablet devices. I don't agree with Google here so right after I've got Android 4.2 on my Galaxy Nexus I started to do some research to get multi user support enabled. My goal was to get a generic app published (probably it needs root access) that would allow to enable multi user support on any Android 4.2 phone.
After some research I figured out this is not possible. Multi user support is deeply integrated into the OS and the only way to get it enabled is by modding a custom ROM. In my investigation I started looking at the AOSP source code. There are two entries points that are relevant: the new UserManager API checks if multi users are supported on the device and KeyguardHostView allows to switch users on the lock screen.
UserManager
If you don't already have the whole AOSP available then you can only download this repository:
git clone https://android.googlesource.com/platform/frameworks/base
base/core/java/android/os --> UserManager.java --> function getMaxSupportedUser():
SystemProperties.getInt("fw.max_users",
Resources.getSystem().getInteger(R.integer.config_multiuserMaximumUsers))
This can be achieved quite easily. Open a shell and type:
su
setprop fw.max_users 5 (actually any value > 1 works)
Now the user menu is visible in Android settings. Here you can choose "Create new user" just like you do on your Nexus 7. A new user account is created and your phone is running in the new user account. In the QuickSettings notification bar you go back to your lock screen. However the icons to switch users are missing. So let's look at the lock screen....
KeyGuard
Download the repository:
git clone https://android.googlesource.com/platform/frameworks/policies/base
base/policy/src/com/android/internal/policy/impl/keyguard --> KeyguardHostView.java
Actually what happens here is that KeyboardHostView is trying to add the KeyguardMultiUserSelectorView layout into the lock screen if the number of users is greater than one. Unfortunately we will see an exception in logcat because layout R.id.keyguard_user_selector is simply not included in phone layouts. Probably we could change build.prop to enable tablet mode and get it enabled, but that's not really what we want to do.
Now the idea is to develop a lock screen widget that would simulate the KeyboardHostView. The app probably needs to be installed as system app so it's available for all users. So let's go ahead and look what exactly is happening...
First the list of users is retrieved:
UserManager um = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
um.getUserList()
This user list is added to KeyguardMultiUserSelectorView:
base/policy/src/com/android/internal/policy/impl/keyguard --> KeyguardMultiUserSelectorView.java
In order to finally switch users it just calls:
ActivityManagerNative.getDefault().switchUser(avatar.getUserInfo().id);
Doesn't really look like rocket science! Let's try to reproduce this in our own app....
Implementation
The UserInfo class (which is returned in a List in getUserList) is not included in Android SDK. Copy into your project from AOSP sources:
base/core/java/android/content/pm/UserInfo.java
Some little hack for a hidden constructor:
public UserHandle getUserHandle() {
// Constructor UserHandle(int) is hidden, use public constructor instead
Parcel pId = Parcel.obtain();
pId.writeInt(id);
return new UserHandle(pId);
}
Oh well, the UserManager.getUserList() is hidden. Use reflection to retrieve the user list:
List<UserInfo> users = new ArrayList<UserInfo>();
final UserManager userManager = (UserManager) getSystemService(Context.USER_SERVICE);
Method getUsers = userManager.getClass().getMethod("getUsers", null);
users = (List<UserInfo>) getUsers.invoke(userManager, null);
ActivityManagerNative is nowhere available. Use reflection to get an instance:
Class activityManagerNative = classLoader.loadClass("android.app.ActivityManagerNative");
Method getDefault = activityManagerNative.getMethod("getDefault", null);
Object instanceActivityManagerNative = getDefault.invoke(null, null);
Too lazy to figure out the proper call to getMethod, so just search for switchUser method:
Method switchUser = null;
Method methods[] = instanceActivityManagerNative.getClass().getDeclaredMethods();
for (Method m : methods) {
if (m.getName().equals("switchUser")) {
switchUser = m;
}
}
Call switch user with some ID that we retrieved from the user list:
switchUser.invoke(instanceActivityManagerNative, new Object[] { users.get(1).id } );
Executing this code will crash because we are missing some permissions....
Permissions
android.permission.MANAGE_USERS is needed for getUserList()
This permission has androidrotectionLevel="signature|system"
--> Install app in system partition (we'd like to do this anyway) and the permission is granted
android.permission.INTERACT_ACROSS_USERS_FULL is needed for switchUser(). However this permission has androidrotectionLevel="signature".
Here we can already stop because the app needs to be signed with platform key in order to get this permission. Sadly there's no way we can do this on devices with a retail firmware. Only way to get this permission is by building our own ROM from AOSP.
Besides, the alternative permission android.permission.INTERACT_ACROSS_USERS only has androidrotectionLevel="signature|system" but it seems this is not good enough for switchUser()....
Implementation in Custom ROMs
As we can directly modify the framework files this shouldn't be too much effort:
--> set the fw.max_users system property to a value > 1
--> copy the KeyguardMultiUserSelectorView layout from a tablet device (R.id.keyguard_user_selector)
I don't really have the time and motivation to maintain any custom ROMs so I'm stopping here.
Thanks!
Hey just wondering if you could explain more on the second part. I got the first part enabled perfectly. Thanks
illinoissparks18 said:
Hey just wondering if you could explain more on the second part. I got the first part enabled perfectly. Thanks
Click to expand...
Click to collapse
what do you exactly mean with "second part"?
If you don't mind root access then you can use Switchme. It's an app that allows user profiles to be created and used. It's fairly stable too.
McJesus15 said:
If you don't mind root access then you can use Switchme. It's an app that allows user profiles to be created and used. It's fairly stable too.
Click to expand...
Click to collapse
I know about Switchme. However this thread is only about Android's native user management.
Lol sorry I got the user tab to show up. Now i need the lockscreen features haha sorry
illinoissparks18 said:
Lol sorry I got the user tab to show up. Now i need the lockscreen features haha sorry
Click to expand...
Click to collapse
Probably you mean this part?
copy the KeyguardMultiUserSelectorView layout from a tablet device (R.id.keyguard_user_selector)
Click to expand...
Click to collapse
You can only achieve this my compiling from source and migrate the user selection view into the phone layout. The most complicated part is probably to find some free space on the screen
Native multi user support works on Android 4.2 phone
I've got Android 4.2 on my Galaxy Nexus I started to do some research to get multi user support enabled. After some research I figured out this is very simple. It is only two steps from native multi user support on your phone.
1. First of all you need to enable "User" menu in Android settings:
Open build.prop file with any text editor and add line (actually any value > 1 works):
fw.max_users=5
2.Next, to make the icons to switch users visible - change display resolution.
Open build.prop file with any text editor find line with parameter ro.sf.lcd_density and change value from 320 to 192
Save changes what you made just. Reboot your phone and enjoin native multi user support on your phone.
ArtuCer said:
I've got Android 4.2 on my Galaxy Nexus I started to do some research to get multi user support enabled. After some research I figured out this is very simple. It is only two steps from native multi user support on your phone.
1. First of all you need to enable "User" menu in Android settings:
Open build.prop file with any text editor and add line (actually any value > 1 works):
fw.max_users=5
2.Next, to make the icons to switch users visible - change display resolution.
Open build.prop file with any text editor find line with parameter ro.sf.lcd_density and change value from 320 to 192
Save changes what you made just. Reboot your phone and enjoin native multi user support on your phone.
Click to expand...
Click to collapse
The different density activates the tablet layout. But your apps and everything changes from phone UI to tablet UI as well, doesn't it?
ramdroid77 said:
The different density activates the tablet layout. But your apps and everything changes from phone UI to tablet UI as well, doesn't it?
Click to expand...
Click to collapse
Well, it is one more way.
ArtuCer said:
Well, it is one more way.
Click to expand...
Click to collapse
Yes it's possible, I wrote this in my analysis as well. But for daily use a phone is simply not usable when using the tablet UI.
ramdroid77 said:
Yes it's possible, I wrote this in my analysis as well. But for daily use a phone is simply not usable when using the tablet UI.
Click to expand...
Click to collapse
I got the multi-users running nicely with Vanilla RootBox and changing the screen density.
Is there no quick way to "hack" the x,y co-ords of the icons? Rather than compiling a full build? I don't mind tinkering, but don't really want to start creating full builds when the Rom I'm using is running nicely without it.
EDIT - solved.
Okay, found a simple way via:
http://forum.xda-developers.com/showthread.php?p=37146983
and
http://forum.xda-developers.com/showthread.php?t=2063195
OP, may I ask something?
Is it possible for a third party app (not a system app) to check if there is more than 1 user that uses the device?
if not, would root help?

[Q] Service menu, PA Gain State, any info on this or defaults?

Hey everyone, doesnt seem to be but 1 thread on this with the service menu. I was looking into it to see if I could see the same sim unlock menu that I used on my S3. Instead on key input, it 1 time changed the field "PA Gain State" to a different value. Now its just at a "1" I dont know if thats the default or not. One other thread says "0" is the normal. However seems now, that field wont change for me. So can anyone let me know if you really can do stuff in this service menu? If so, whats the defaults and how on earth do values get changed and other times, like now, just stay at the value they are at without being changed any. Making sure I didnt just mess something up here. Dont even know what that field is, or the rest of them. (I am assuming PA field is for volume gain table tho), so just checking on if something really could get messed up here. Thanks.

Categories

Resources