There are some apps that need run full-screen and I am finding that the status bar interferes? Example, Softick Klondike Solitaire - unfortunately a great game but the developer put the score line so that it's hidden by the HoneyComb status bar. So I'd like to hide the status bar - there may be other apps that need this too
hide system bar
I have same question - I need to develop application for internal use, but without native 3.0 navigation (back, home, apps at system bar). One way I found - set ro.sf.lcd_density to 240, system think that this is mobile phone and change interface to show top status bar without any system bar, and status bar can be removed in program, but in this case I have to rebuild program layouts and this solution is not very good for other applications.
It look like system bar placed very deep inside android 3.0 code, so now I even thinking about porting android 2.3 to Iconia A500.
Any ideas?
z4gnom said:
I have same question - I need to develop application for internal use, but without native 3.0 navigation (back, home, apps at system bar). One way I found - set ro.sf.lcd_density to 240, system think that this is mobile phone and change interface to show top status bar without any system bar, and status bar can be removed in program, but in this case I have to rebuild program layouts and this solution is not very good for other applications.
It look like system bar placed very deep inside android 3.0 code, so now I even thinking about porting android 2.3 to Iconia A500.
Any ideas?
Click to expand...
Click to collapse
Transformer has Froyo running. http://forum.xda-developers.com/showthread.php?t=1078840
If I remember correctly, some XDA member got an A500 running Froyo to.. He bought it that way, but I dont know if he still has it.
Unless 3.1 or another update provides a solution, Honeycomb is stuck with it, which is lame for for a few reasons:
Easy to touch by mistake, and is no different than having a smaller display, since the space is taken by it. At least iOS gets this right and does not take up space. One of the few things they DID get this right.
just realized that system bar can be removed by killing systemUI service, this service is hidden in "running", but can be found in "all" and can be easily stopped.
now looking for program solution to kill it and restore by me application
I know there is a setting in Launcher Pro that you can hide it on phones, I dont know if it will work with this though.
Guys keep in mind this becomes less of an issue if you can get developers to update their apps for the Honeycomb SDK. There's a mode they call "lights out" that causes the system bar to dim tremendously - which is what the youtube app does.
Maybe instead of killing it, a third party app that causes it to go to dim mode and stay there - kind of a toggle - would be more appropriate so you don't lose the use of the buttons.
http://stackoverflow.com/questions/...-lights-out-mode-in-honeycomb/5097719#5097719
cybermage1 said:
Guys keep in mind this becomes less of an issue if you can get developers to update their apps for the Honeycomb SDK. There's a mode they call "lights out" that causes the system bar to dim tremendously - which is what the youtube app does.
Maybe instead of killing it, a third party app that causes it to go to dim mode and stay there - kind of a toggle - would be more appropriate so you don't lose the use of the buttons.
http://stackoverflow.com/questions/...-lights-out-mode-in-honeycomb/5097719#5097719
Click to expand...
Click to collapse
The brightness is not the issue, but the space the black bar takes up is. Kind of like the old CRT days when the bezel was quoted as part of the screen size. For 3.1 users, a 10.1" display is really 9.6, since space is taken up by the bar.
I went back to using my gTablet for now and notice that I have more display (though a display with awful angles).
Call me stupid, but I would prefer Gingerbread on the A500:
1. Games would work fine
2. Display resolution not compromised
3. Flash works fine
4. Less issues with legacy apps and Tiger Arcade has no scaling issues.
5. Actually, no apps have scaling issues with Gingerbread, but a lot do with Honeycomb, so need to wait/hope the devs update.
Yes, defeats the purpose of the tablet centric OS, but the bar at the bottom is a waste of display space.
"Honeycomb has a hidden Gingerbread (Android 2.3) UI within it.
And it can be very easily unhidden by simply changing the LCD density. Set it to 170 or higher, reboot, and you'll see all the graphical elements of Gingerbread (lock screen, dock, app drawer, keyboard, etc.); set it to 160 or lower and the Honeycomb you're used to will greet you after a reboot."
Sent from my GT-P1000 using XDA Premium App
the status bar has the soft keys... trust me, its nice to have since there are no hard keys for this device. this was a feature that was implemented for nook color in cyanogenmod because the lack of hard keys and it made all the difference. how are you going to press back or menu if you don't have that status bar? sure you could use the softkeys app or button savior but they are inconvienient and also put stuff on your screen.
Sent from my A500 using Tapatalk
com.android.systemui
I tested some ways to kill system bar:
1. Kill by adb shell: - su; ps, look for com.android.systemui; kill <PID> - success, sys-bar removed.
2. Settings, "Sytem UI" force stop - success, sys-bar removed.
3. Root explorer, delete /system/app/systemui.apk - got circle of error messages "com.android.systemui crashed, blabla...". Reboot, tablet started without system bar, no any errors, so success.
4. My app:
Code:
android.os.Process.killProcess(android.os.Process.getUidForName("com.android.systemui"));
failed, as expected, because my app can not kill process started by another app.
5. My app:
permission - android.permission.KILL_BACKGROUND_PROCESSES
Code:
final Context context = getApplicationContext();
servMng = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
servMng.killBackgroundProcesses("com.android.systemui");
Failed, no idea why.
6. Run script in my app to execute "ps", look for PID and execute "kill", not tested.
I need to implement option 5 or 6, can anyone give me some hints why 5 failed (or how to perform 6)?
Also I need to restore system bar using my app, I tested "am start blabla", it work in some cases throwing some errors and do not work in other cases depending on moon state, I do not know exact parameters for "am", also best solution to run in from app using java, any ideas how to do it "correctly"?
Lights Out mode
Part of the honeycomb API is a Lights out mode that dims the status bar so much that you can hardly see it. If you want to see it in action, just open the Kindle app.
Until 3rd parties update their full screen apps with this API, it would be nice for a third party app to implement it.
brunes said:
Part of the honeycomb API is a Lights out mode that dims the status bar so much that you can hardly see it. If you want to see it in action, just open the Kindle app.
Until 3rd parties update their full screen apps with this API, it would be nice for a third party app to implement it.
Click to expand...
Click to collapse
1st page...
http://forum.xda-developers.com/showpost.php?p=13981583&postcount=8
~~~~~
Greetings from XOOM land.
I was brainstorming a way to hide the status bar and bring it out again when needed. It seems Windows 8 will do just that, and will use the same method I had in mind.
The idea is to use a multitouch gesture to hide it and bring it back. Touch the screen with two fingers and swipe off of the bottom of the tablet screen as if flicking the status bar away, and it kills it. Swipe up from off the screen to bring it back.
Now, implementing this would be difficult, at least for me, but I think it would be awesome to get the bar out of the way sometimes.
arrtoodeetoo said:
Now, implementing this would be difficult, at least for me, but I think it would be awesome to get the bar out of the way sometimes.
Click to expand...
Click to collapse
try to implement option (one of) described in my 1st post on this page (#11)
here is developer.android.com/guide/topics/ui/actionbar.html google description how to remove action bar in 3.0+:
manifets
<activity android:theme="@android:style/Theme.Holo.NoActionBar">
or runtime
ActionBar actionBar = getActionBar();
actionBar.hide();
manifest do nothing, and code in runtime throw "force close blabla".
Anyone was able to do it this way?
added: hmm, it look like this is another one bar at top of screen, so do not pay attention to this post
Non-programatically you can kill it in Settings under manage applications, System UI.
Therefore, would it be posible to launch this settings page, send a couple of virtual D-PAD key presses to select the force quit button, and then Return key presses to press the button. Is this possible, using a persistant IME perhaps?
kill:
Code:
Process proc = null;
try {
proc = Runtime
.getRuntime()
.exec(new String[] { "su", "-c",
"service call activity 79 s16 com.android.systemui" });
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
proc.waitFor();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
restore:
Code:
Process proc = null;
try {
proc = Runtime.getRuntime().exec(
new String[] { "am", "startservice", "-n",
"com.android.systemui/.SystemUIService" });
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
proc.waitFor();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
and finally - root needed for two posts above.
credits: http://android.serverbox.ch/?p=306
Related
Hi All,
I cracked open Remote Spy++ and started figuring out how I could go about writing a Honeycomb start menu replacement for WM5-6.1 (seen the XP Start Replacement? Same idea). Having written something similar on desktop Windows I thought it would be easy. The app is in C#/CF.
So the window hierarchy is:
Code:
- Desktop
- HHTaskBar
- (nothing !!!)
And messages of interest (in order):
Code:
WM_LBUTTONDOWN (0x201)
WM_PAINT (0xF)
WM_INITMENUPOPUP (0x117)
Okay, so forgetting about the fact that the window is opaque (I will delve into this later on), I went ahead and subclassed it to catch the WM_LBUTTONDOWN message (the others didn't stop the original from showing up). That falls over (the debugger doesn't even break into code and the device needs a hard reset). I am investigating this - although my MessageBox shows up just before it dies.
Update: Using BeginInvoke with a worker method fixes the above issue. E.g:
Code:
public IntPtr NewWndProc(IntPtr hWnd, uint msg, IntPtr wParam, IntPtr lParam)
{
if (msg == WM_LBUTTONDOWN)
{
this.BeginInvoke(new Action(DoWork));
return IntPtr.Zero;
}
return CallWindowProc(oldWndProc, hWnd, msg, wParam, lParam);;
}
private void DoWork()
{
Form2 two = new Form2();
two.Show();
}
So my question: the HHTaskBar is opaque, it has no child controls. Obviously, I don't want to subclass the battery/close/etc. buttons, and ideas on how to reliably retrieve the rect for the start button?
Or is the whole thing a hack? I suspect there is a way to do this without all this subclassing hackery. Google and forum search didn't turn up anything.
Thanks guys.
Source code
Usage: (not recommended on real device - use an emulator!) Click on button1 then click anywhere on the taskbar. Now reboot
I'd start with Quickmenu:
http://forum.xda-developers.com/showthread.php?t=471292
This app is the best start menu replacement I ever saw...
I'd only add a mixture of WKTASK's taskbar management and the ability to choose a icon for the start menu.
Thanks
twolf said:
I'd start with Quickmenu:
http://forum.xda-developers.com/showthread.php?t=471292
This app is the best start menu replacement I ever saw...
I'd only add a mixture of WKTASK's taskbar management and the ability to choose a icon for the start menu.
Click to expand...
Click to collapse
Thanks, it doesn't look like he has any source code available though. Looks like I will have to investigate more... I am not going for the drop down style (but as you said, it is really cool), I am trying to make a Honeycomb (WM 6.5) style menu.
I tried the wm6.5 honeycomb start menu... was not impressed, but maybe it had some extra something i didnt noticed... :/
I still haven't flashed my device with 6.5, but I reckon a FOSS honeycomb menu could be cool...
I think you'r on to something here. The start menu as it is in WM6.1 is pretty much useless. I would much rather have the start menu show me a application shortcut page like the one in WM6.5. Although to be honest I don't really like the honeycomb look. What's wrong with a plain old columns and rows type of thing. With the added physics scrolling/swiping stuff of course
frepe383 said:
I think you'r on to something here. The start menu as it is in WM6.1 is pretty much useless. I would much rather have the start menu show me a application shortcut page like the one in WM6.5.
Click to expand...
Click to collapse
Exactly! I am also hoping to replace that shoddy settings menu.
frepe383 said:
Although to be honest I don't really like the honeycomb look. What's wrong with a plain old columns and rows type of thing. With the added physics scrolling/swiping stuff of course
Click to expand...
Click to collapse
I think something with tabs (like Manila 2D) such as 'Programs', 'Running Programs', 'Settings' would be pretty useful. Skinning is a given, and honeycomb would be one (for the fanatics).
Update
I decided to call the tool Mead (as in the beer that contains honey ).
I was having problems with the default message pump and the hook (well, subclassed event). I am not sure which message was crashing my program, but if I use Application.Run() a native exception occurs in mscoree3_5.dll. The workaround is to create the form in the handler for the hook and show that one (it wasn't a UI thread being called from a worker, I am aware of that). So I think it must be a CF message pump bug. In any case, it works great now.
Quitting isn't all the way there yet, still some bugs (the type that will need a soft reset).
On to the UI stuff.
clickety
Excellent idea mate, but is it worth doing? the Beta 2 of 6.5 is already out and i am guessing its not long until the final version
Any news on this?
Nope
Nothing new. Just haven't had time between my job.
For now I am pinning it as the native call-in issue that the .Net CF suffers from (a documented limitation). Something isn't quite right.
I will continue to experiment, but push comes to shove, I will probably land up creating an interop library for it.
Instead of subclassing, you can just create a childwindow of HHTaskbar that is located over the start button.
Alternatively, you could suPerclass the "Explore" window class just to replace the Programs menu. Beware, that superclassing may be a bit dangerous
Interesting Idea
That is an interesting idea. When I get time I will start messing around with it.
That said I do expect some problems: again the interop call-in to .NET CF, but this may prove to work as a work-around .
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?
Hi all,
Title really says it all. I have a tabs set up at the moment but I want to add a spinner to the action bar as well. To use as sort of a category tool. So a user can go through the tabs but also simply what they are seeing by selecting something from the dropdown spinner.
I've seen tutorials for a spinner in the actionbar and they require the navigation to be changed to list
Code:
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
Mine at the moment is of course
Code:
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
Is it possible to have both? I have a title and tabs underneath to the title action bar is empty at the moment, a perfect place for a spinner. This is what I have right now: http://i1.ytimg.com/vi/ppuv-FP6c4w/maxresdefault.jpg I'd like to be able to add a spinner that is always showing where it says 'ABS ViewPager Tabs'
Any help would be appreciated. Haven't found a tutorial that integrates both yet.
RED_ said:
Hi all,
Title really says it all. I have a tabs set up at the moment but I want to add a spinner to the action bar as well. To use as sort of a category tool. So a user can go through the tabs but also simply what they are seeing by selecting something from the dropdown spinner.
I've seen tutorials for a spinner in the actionbar and they require the navigation to be changed to list
Code:
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
Mine at the moment is of course
Code:
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
Is it possible to have both? I have a title and tabs underneath to the title action bar is empty at the moment, a perfect place for a spinner. This is what I have right now: http://i1.ytimg.com/vi/ppuv-FP6c4w/maxresdefault.jpg I'd like to be able to add a spinner that is always showing where it says 'ABS ViewPager Tabs'
Any help would be appreciated. Haven't found a tutorial that integrates both yet.
Click to expand...
Click to collapse
Since the ActionBarSherlock library is closesly related to the native action bar, I googled and found this similar question. It seems that, using these libraries it is not possible, however there are several methods to use instead (but those aren't so nice).
Bugger. Guess I could try doing it with a custom view and work from there like shown in that link. Hmmm, might have to rethink how my app lets users navigate.
That stuff that I plan to put in the spinner has to be somewhere so I guess I should look to creating this custom actionbar thingy. Hopefully the output is smooth. Already using a ViewPager that the guy who answered mentioned so this may not be too hard.
RED_ said:
Bugger. Guess I could try doing it with a custom view and work from there like shown in that link. Hmmm, might have to rethink how my app lets users navigate.
That stuff that I plan to put in the spinner has to be somewhere so I guess I should look to creating this custom actionbar thingy. Hopefully the output is smooth. Already using a ViewPager that the guy who answered mentioned so this may not be too hard.
Click to expand...
Click to collapse
This video from Google I/O 2013 helped me very much with my app navigation design: http://www.youtube.com/watch?v=XpqyiBR0lJ4&list=PLOU2XLYxmsIJOOTFfYzhR2d-rcSbBbEE_
nikwen said:
This video from Google I/O 2013 helped me very much with my app navigation design: http://www.youtube.com/watch?v=XpqyiBR0lJ4&list=PLOU2XLYxmsIJOOTFfYzhR2d-rcSbBbEE_
Click to expand...
Click to collapse
Thanks, I'll give that watch.
I'm currently using GridViews with custom adapters to show my content under each tab so if I could have an onClick change what the getView() method of the adapter shows to a user I could just keep it really simple and have simple buttons instead of a spinner.
That seems like a good option at the moment.
Hi,
I'm a french Android rookie, so excuse my english and my perhaps naive questions...
I am developing an app for Android (minSdk 14).
My main activity is a Processing PApplet, which has to be fullscreen, without an action bar.
From this activity, I want to launch a view to pass variables to my applet. I use onCreateOptionsMenu to open the options menu.
When I press the only item on this menu, I launch a "activity_settings"activity.
So far so good, but it bothers me that the user has to press the Options button, then the "Settings" button in the options menu.
So I tried to directly launch my "activity_settings" activity in onCreateOptionsMenu, without inflating the options menu.
It works the first time, but then "activity_settings" doesnt want to open any more ...
If I do the same thing using onPrepareOptionsMenu instead of onCreateOptionsMenu, it works and works again without problems ...
I do not understand why! If any nice coder wants to explain to me ... that would be nice!
Another issue, I cannot capture the size of an OnTouch event .
Code:
@Override
public boolean onTouchEvent(MotionEvent event) {
Log.d("Touched", String.valueOf(event.getSize()));
return super.onTouchEvent(event);
}
LogCat always shows "Touched" 0.0
Is it because of my device? Samsung GT7560 (Galaxy Trend)
Thank you in advance!
marzinp said:
Hi,
I'm a french Android rookie, so excuse my english and my perhaps naive questions...
I am developing an app for Android (minSdk 14).
My main activity is a Processing PApplet, which has to be fullscreen, without an action bar.
From this activity, I want to launch a view to pass variables to my applet. I use onCreateOptionsMenu to open the options menu.
When I press the only item on this menu, I launch a "activity_settings"activity.
So far so good, but it bothers me that the user has to press the Options button, then the "Settings" button in the options menu.
So I tried to directly launch my "activity_settings" activity in onCreateOptionsMenu, without inflating the options menu.
It works the first time, but then "activity_settings" doesnt want to open any more ...
If I do the same thing using onPrepareOptionsMenu instead of onCreateOptionsMenu, it works and works again without problems ...
I do not understand why! If any nice coder wants to explain to me ... that would be nice!
Another issue, I cannot capture the size of an OnTouch event .
Code:
@Override
public boolean onTouchEvent(MotionEvent event) {
Log.d("Touched", String.valueOf(event.getSize()));
return super.onTouchEvent(event);
}
LogCat always shows "Touched" 0.0
Is it because of my device? Samsung GT7560 (Galaxy Trend)
Thank you in advance!
Click to expand...
Click to collapse
Regarding the onCreateOptionsMenu, It works the first time only because this method is called only once when the activity is created, and the options menu is created.
The onPrepareOptionsMenu is called every time it the menu is shown, like every time you go back to the activity (The activity is resumed not created).
alphascript said:
Regarding the onCreateOptionsMenu, It works the first time only because this method is called only once when the activity is created, and the options menu is created.
The onPrepareOptionsMenu is called every time it the menu is shown, like every time you go back to the activity (The activity is resumed not created).
Click to expand...
Click to collapse
Thanks a lot, I didn't figure that! Ishould have!
For the second part of my question, it's definitely my device that isnt able to mesure pressure nor size of the touch.
Showing pointers from the dev options gave me the answer. Now I have to figure another way of capturing the touch size...
marzinp said:
Thanks a lot, I didn't figure that! Ishould have!
For the second part of my question, it's definitely my device that isnt able to mesure pressure nor size of the touch.
Showing pointers from the dev options gave me the answer. Now I have to figure another way of capturing the touch size...
Click to expand...
Click to collapse
See:
https://groups.google.com/forum/#!topic/android-developers/10pF8EUEuy0
Introduction
What is it?
Yota Toolbelt is my stab at developing something useful for the Yotaphone 2. It's a functional widget for the back screen, combined with a simple front screen widget. It has been tested on the latest Lollipop firmware (1.44).
What it does?
- The front screen widget allows you to toggle mirroring mode with a single click.
- The back screen widget allows you to toggle mirroring, wifi, Bluetooth, wifi tethering, ringer mode and YotaEnergy. Additionally you can place shortcuts to URLs to open your favorite websites quickly.
- The new "Contact list" action allows you to browse your contact list, make calls and send SMS's from it.
Click to expand...
Click to collapse
Images
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Check the screenshots tab for more
Click to expand...
Click to collapse
Installation instructions
I'm not going to bother putting this on Google Play because of the extra work with little benefit, so you have to install the apk manually. Here's how:
1. Check "allow installation of apps from unkown sources" from Settings - Security so that you can install the file.
2. Download the apk file and put it on your phone, or download it to your phone directly.
3. Open the apk file with some file manager and install it.
After this you can add the front screen widget like you would add any widget, by long pressing your home screen, selecting widgets, and then dragging the "Yota Toolbelt" on your home screen.
The back screen widget can be added from Yotahub.
Click to expand...
Click to collapse
Download
Download here (1.0.4)
Click to expand...
Click to collapse
Changelog
Code:
Current changelog: 2015-07-11
Version 1.0.4
- [NEW] Toggle for Wifi tethering.
- [NEW] Toggle for ringer mode: Normal/Vibrate (Toggling silent mode is simply not possible on Lollipop - Thanks Google!)
- [CHANGE] Added shortcuts to related system settings on long press to all but the Mirror widget in the config utility.
Old change logs:
Code:
Version 1.0.3
- [NEW] General settings for Contact list. These settings affect ALL INSTANCES of contact lists.
---- Choose the sort order
---- Choose name format
---- Choose dialer (EPD / mirrored). This should be changed only if you are having trouble making calls from the Contact list.
---- Lock EPD automatically when calling from Contact list to prevent accidental presses.
- [NEW] Added fast scroll support for the Contact list
- [FIX] Fixed Contact list not always closing after sending SMS or making a call
- [FIX] Fixed Mirror widget starting in incorrect state when mirrored.
Version 1.0.2
- [NEW] Contact list
- [FIX] Fixed a bug where widgets would not react after a while
Version 1.0.1
- [NEW] More advanced configuration utility
- [NEW] Battery level monitor / YotaEnergy toggle
- [NEW] Support for bookmark shortcuts that can be opened in EPD browser
or the default system browser in mirrored mode
- [NEW] Support for all widget sizes
- [NEW] Support for white theme
- [CHANGE] Changed the graphics to follow Yota's icons more closely.
Click to expand...
Click to collapse
Known issues
- This Widget requires Lollipop to work. No backwards compatibility.
- The battery widget doesn't have push effect. Also, toggling YotaEnergy on takes surprisingly long time. There's nothing I can do about that.
Click to expand...
Click to collapse
FAQ
The graphics.. They look.. ehrm..
- Awesome, right!? I'm a programmer, not an artist. If someone wants to create new graphics for the widget, I am very willing to change them. Each button should be the same size, at least 140x140px.
What are all these permissions?
- Bluetooth/Wifi/Network permissions are required for toggling wifi and Bluetooth directly without the system's dialogs.
- The vibration permission allows the buttons to vibrate on click.
- The READ_CONTACTS permission is for the new contact list portion, allowing it to list your contacts.
- The PHONE_CALL permission is for making a call using the front screen's dialer.
- The READ_PHONE_STATE is used for making the "lock EPD on dial" function work
Click to expand...
Click to collapse
For developers
I had to do some serious reverse engineering to figure out how to activate and deactivate the mirroring and YotaEnergy, so to save everyone's time, here's how to do it:
Activate mirroring from front screen:
Code:
Intent i = new Intent("yotaphone.intent.action.MIRRORING_START");
context.sendBroadcast(i);
i = new Intent("yotaphone.intent.action.MIRRORING_START_MANUAL");
context.sendBroadcast(i);
Activate mirroring from back screen:
Code:
Intent i = new Intent("yotaphone.intent.action.MIRRORING_START_FROM_BS");
context.sendBroadcast(i);
Deactivate mirroring:
Code:
Intent i = new Intent("yotaphone.intent.action.MIRRORING_STOP");
context.sendBroadcast(i);
To check is mirroring on right now, and to lock the EPD (asynchronous):
Code:
ServiceConnection mConnection = new ServiceConnection() {
public void onServiceConnected(ComponentName className, IBinder service) {
IFrameworkService mService = IFrameworkService.Stub.asInterface(service);
boolean isMirroringOn = mService.isMirroringOn();
mService.lockBackScreen();
}
public void onServiceDisconnected(ComponentName className) {}
};
Intent i = new Intent("yotaphone.intent.action.GET_SERVICE_BINDER").setPackage("com.yotadevices.yotaphone2.bsmanager");
context.getApplicationContext().bindService(i, mConnection, Context.BIND_AUTO_CREATE);
//Remember to unbind when you don't need the service anymore
To detect when mirroring is started, listen for the following broadcast:
Code:
yotaphone.intent.action.MIRRORING_START
To detect when mirroring ends, listen for both of these broadcasts:
Code:
yotaphone.intent.action.MIRRORING_STOP_MANUAL
yotaphone.intent.action.MIRRORING_STOP
To turn YotaEnergy on:
Code:
final Intent i = new Intent("yotaphone.intent.action.POWERSAVE_START");
context.sendBroadcast(i);
To turn YotaEnergy off:
Code:
final Intent i = new Intent("yotaphone.intent.action.POWERSAVE_STOP");
context.sendBroadcast(i);
To open Yota's EPD browser:
Code:
Intent i = new Intent();
i.setComponent(new ComponentName("com.yotadevices.yotaphone.yd_browser", "com.yotadevices.yotaphone.yd_browser.BSBrowser"));
i.putExtra("URL_TO_OPEN", "http://www.google.com");
context.startService(i);
Click to expand...
Click to collapse
XDA:DevDB Information
Yota Toolbelt, Device Specific App for the YotaPhone
Contributors
Jeopardy
Version Information
Status: Stable
Current Stable Version: 1.0.4
Stable Release Date: 2015-07-11
Created 2015-06-28
Last Updated 2015-07-11
Suggest features
I am open to suggestions for functions to add. Functions I've considered:
Flashlight - this one's doable, but it seems a little pointless. How are you going to turn the flashlight on in the dark when there's no backlight on the EPD?
Volume/Vibrate/Silent toggle - Probably doable, but requires some work so that it's easy to use.
Rotation lock - Not sure about this, but pointless anyway. The rear screen doesn't support horizontal view in the first place, unless you're mirroring, and then you might as well use widgets on your front screen.
Airplane mode - This one requires root access, and is quite hacky to implement.
NFC toggle - Cannot be done without root.
GPS toggle - Cannot be done without root.
Any ideas?
Thanks for doing this.
You might want to add Hotspot and data network
Would you be able to add Shortcuts? That would be very useful and its a shame the stock app does not allow this.
All Day On XDA said:
Thanks for doing this.
You might want to add Hotspot and data network
Would you be able to add Shortcuts? That would be very useful and its a shame the stock app does not allow this.
Click to expand...
Click to collapse
I'll look into your suggestions. I think the hotspot function required root access, and that is not very user friendly.
About the shortcuts - Isn't the stock Apps Launcher widget exactly what you're looking for?
Jeopardy said:
I'll look into your suggestions. I think the hotspot function required root access, and that is not very user friendly.
About the shortcuts - Isn't the stock Apps Launcher widget exactly what you're looking for?
Click to expand...
Click to collapse
the stock app allows links to apps only. Shortcuts are a subset of apps that can be added to the desktop. Eg in Google Maps you can create a shortcut on your homescreen that starts directions to a pre set destination. Or eg Chrome allows shortcuts to websites to be placed on the homescreen.
Edit: This may be beyond the scope of this widget. Apologies
All Day On XDA said:
the stock app allows links to apps only. Shortcuts are a subset of apps that can be added to the desktop. Eg in Google Maps you can create a shortcut on your homescreen that starts directions to a pre set destination. Or eg Chrome allows shortcuts to websites to be placed on the homescreen.
Edit: This may be beyond the scope of this widget. Apologies
Click to expand...
Click to collapse
Ah, I see. I've never used these before.
It is possible yes, but the biggest issue here is how you create and associate them to the widget. By default the shortcuts are created by the applications, like Chrome and Google Maps, and those applications send the shortcut Intent to the Launcher application. There is no way of telling the system that the shortcut should show up on this widget.
It probably could be possible to create these shortcuts manually for supported applications, like Chrome, but that would require quite a lot of work.
Nice work @Jeopardy! Thanks for sharing some dev notes too, might be useful for future widgets/apps.
PS You could officially kick off the "YotaPhone Original Android Development" device subforum with your widget (0 threads there now).
SteadyQuad said:
Nice work @Jeopardy! Thanks for sharing some dev notes too, might be useful for future widgets/apps.
PS You could officially kick off the "YotaPhone Original Android Development" device subforum with your widget (0 threads there now).
Click to expand...
Click to collapse
Thank you. Yeah I was wondering for the right place to put this. Now that you mentioned it, I guess the proper place would be the Original Android Development, but to put it there now would require a moderator.
Jeopardy said:
I am open to suggestions for functions to add. Functions I've considered:
Flashlight - this one's doable, but it seems a little pointless. How are you going to turn the flashlight on in the dark when there's no backlight on the EPD?
Volume/Vibrate/Silent toggle - Probably doable, but requires some work so that it's easy to use.
Rotation lock - Not sure about this, but pointless anyway. The rear screen doesn't support horizontal view in the first place, unless you're mirroring, and then you might as well use widgets on your front screen.
Airplane mode - This one requires root access, and is quite hacky to implement.
NFC toggle - Cannot be done without root.
GPS toggle - Cannot be done without root.
Any ideas?
Click to expand...
Click to collapse
Since I am using the "default" black theme I would prefer to have an option to switch between "black" and "white" version. I already created the changed images to basically switch your images to "all transparent" with white icons and a white circle around them for "pressed status". Since I am a new user I can't attach them to the post yet. Can you tell me a way to share them with you?
Besides that: can you share the sources of your widget to allow us to build upon it ourselves?
Thanks for your work on this!
crazy-ivanovic said:
Since I am using the "default" black theme I would prefer to have an option to switch between "black" and "white" version. I already created the changed images to basically switch your images to "all transparent" with white icons and a white circle around them for "pressed status". Since I am a new user I can't attach them to the post yet. Can you tell me a way to share them with you?
Besides that: can you share the sources of your widget to allow us to build upon it ourselves?
Thanks for your work on this!
Click to expand...
Click to collapse
I just sent you a private message about those images.
I'll consider sharing the source later. At the moment it is rather messy and very much hardcoded. I am currently rewriting the configuration Activity to allow rearranging of the icons and adding some new functions. It will take some time for me to finish this to a level I'm satisfied with.
Jeopardy said:
I just sent you a private message about those images.
I'll consider sharing the source later. At the moment it is rather messy and very much hardcoded. I am currently rewriting the configuration Activity to allow rearranging of the icons and adding some new functions. It will take some time for me to finish this to a level I'm satisfied with.
Click to expand...
Click to collapse
Mail sent.
Thanks for the info. Looking forward to see updates to this useful tool (and the first widget posted in here!).
All Day On XDA said:
the stock app allows links to apps only. Shortcuts are a subset of apps that can be added to the desktop. Eg in Google Maps you can create a shortcut on your homescreen that starts directions to a pre set destination. Or eg Chrome allows shortcuts to websites to be placed on the homescreen.
Edit: This may be beyond the scope of this widget. Apologies
Click to expand...
Click to collapse
I just released an update which addresses your idea of shortcuts for system's default browser (Chrome) and EPD's browser. Now the widget's framework is so flexible that it is very easy to add new shortcut targets. The only problem (still) is that the shortcuts have to be created manually from the widget, which means relatively complex dialogs. Shortcuts for browser is extremely handy, but can you think of some other app whose shortcuts would be as useful?
i have try it on my Yota 2 4.4.3 apk not work !
9100_it said:
i have try it on my Yota 2 4.4.3 apk not work !
Click to expand...
Click to collapse
That was to be expected. I don't think they included the SDK library until Lollipop. Sorry.
Major update
Okay, here's a new update for you guys.
First off, the minor (but important fixes) include fixing nonresponsive buttons if the device has been inactive for a long time, and some minor optimizations.
The big new function is a fully functional contacts list! I had been working on this for a while, waiting for Yota to update their caller app so I wouldn't have to do it. But it seems they are busy doing something else. So I became impatient and decided to include it here, as it needs an EPD widget anyway to launch it. So just add the contact list widget to the toolbelt from options, open it from the back screen, and you can browse all your contacts (with phone numbers) and then call them directly from the EPD. It also supports sending SMS's, but the catch is that it uses the front screen SMS editor via mirroring, not Yota's sleek EPD editor. The reason for this is there's no way to hook up to Yota's editor.
While I was building this update I also noticed quite serious security flaw in Yota's EPD dialer app. By default if you want to make a phone call from your app you need to add android.permission.CALL_PHONE to your manifest. However, I found out that Yota has left their EPD dialer app completely open for any app to ask for immediate phone call (like mine does), without any permissions what-so-ever. What were they thinking?
It also became frustratingly clear how bad the SDK is at the moment. The documentation is nonexistent, and you cannot even create dialogs. So many workarounds had to be made to make this work nicely.
But anyways, let me hear your opinions and experiences. There's bound to be some bugs somewhere and there's plenty of room to expand the contact list portion, provided I have the time.
Looking forward to trying the newest version. Thanks for building this!
You might want to consider contacting the Indiegogo campaign folks, as it looks like you've earned yourself a free phone. I can't post the link because I guess I'm too new a user on here, but if you look at the updates and scroll down to "25 days ago":
FYI: If anyone successfully develops an application or service to work natively for the "always on" display I will reward them with a YotaPhone 2 for FREE at the end of the campaign!
Click to expand...
Click to collapse
MichaelA said:
Looking forward to trying the newest version. Thanks for building this!
You might want to consider contacting the Indiegogo campaign folks, as it looks like you've earned yourself a free phone. I can't post the link because I guess I'm too new a user on here, but if you look at the updates and scroll down to "25 days ago":
Click to expand...
Click to collapse
Wow, might as well try it. Thanks for the info!
Hi thanks for standing in where yota appear to lack
just downloaded and installed but although the contacts list works well the phone dialer doesnt but i do have a call confirm slider app (used to stop wrongly dialed numbers) which could block this (it does the same with yota dialer)
only way i have managed to work around this is to mirror the android dialer app but would be nice if you could? do anything?
like your commitment to develop - think you should look at a donate function somewhere..would buy you a coffee or two for your efforts
regards
kam1962 said:
Hi thanks for standing in where yota appear to lack
just downloaded and installed but although the contacts list works well the phone dialer doesnt but i do have a call confirm slider app (used to stop wrongly dialed numbers) which could block this (it does the same with yota dialer)
only way i have managed to work around this is to mirror the android dialer app but would be nice if you could? do anything?
like your commitment to develop - think you should look at a donate function somewhere..would buy you a coffee or two for your efforts
regards
Click to expand...
Click to collapse
Basically what I do, is ask the official EPD dialer to make the phone call for me. If your call confirm slider app blocks the yota dialer, it will also block this. I guess you cannot add exceptions to the caller app? (Probably not, knowing Android's telephony API...)
An ugly workaround for your specific case would be for me to turn mirroring on when you press the call-button from my contacts list, and then ask the system's default dialer to make the call. Then your call confirm slider app would show up normally in the mirrored mode and you could finish the call. I might consider adding this later on as a setting somewhere, but no promises. It would be a lot cleaner if the mirroring mode would not be needed to finish the call, because turning it on takes quite a while and is a hassle to deal with when trying to do simple actions.
What is the name of the app you are using? I'll take a look.
call confirm
Jeopardy said:
Basically what I do, is ask the official EPD dialer to make the phone call for me. If your call confirm slider app blocks the yota dialer, it will also block this. I guess you cannot add exceptions to the caller app? (Probably not, knowing Android's telephony API...)
An ugly workaround for your specific case would be for me to turn mirroring on when you press the call-button from my contacts list, and then ask the system's default dialer to make the call. Then your call confirm slider app would show up normally in the mirrored mode and you could finish the call. I might consider adding this later on as a setting somewhere, but no promises. It would be a lot cleaner if the mirroring mode would not be needed to finish the call, because turning it on takes quite a while and is a hassle to deal with when trying to do simple actions.
What is the name of the app you are using? I'll take a look.
Click to expand...
Click to collapse
thanks for reply been searching for it but cannot find it anywhere on app store!!! so guessing its gone
must have transferred from old phone or it just been removed from market this year? cannot remember
its called call confirm slider version 0.9.1 icon is black circle with telephone handset inside but dont have any other details.
had it for a few years now and has been stable / reliable
very similar to this
https://play.google.com/store/apps/details?id=com.callconfirmer.free
regards