Subclassing the Start Button - Windows Mobile Development and Hacking General

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 .

Related

Scroll bar control, accessing, WM_HSCROLL

Hi all (and no worries vijay555.... I'm new to forums and my Axim x51v... hope I'm doing this right... and thank you for your assistance!!!)
Keystrokes as code?
Specifically Excel Mobile keyboard shortcut Alt-PgUp/Dn (scrolls one screen width left/right)
I've created several Keystroke "routines" to minimize stylus use in Excel Mobile. I've mapped to hardware buttons, and they all work great... except Alt-PgUp(and PgDn). In Excel, these key combos will scroll one screen left or right, respectively. Other similarly-coded "routines" work as expected.
I've worked around this for now by recording screentaps in Excel's horizontal scrollbar. Unfortunately, the location of that s/b depends on whether SIP is active. If it is, the vertical co-ordinates of the screentaps become irrelevant and/or potentially destructive to my intended result. I prefer to avoid "position dependent" commands whenever possible for obvious reasons.
I have several other programs at my disposal to effect the Alt-PgUp/Dn shortcut(s).... IF I knew how to define the values(?) of Alt-PgUp/Dn in a script.
(MortScript, PHMkeys, Pen Commander, Spb FullScreenKb, PDA MediaKb)
I've been all over the web, and I think I understand keystroke scan-codes and values... and how they work together. Is there something akin to an ASCII "value" for this key combination? (099/0A1; 073/081; 153/161)?
Any ideas are appreciated. I've no aversion to research or work, but can't figure out what to ask or where to look further.
(I just really need a more direct/reliable functionality to scroll entire screen at a time left/right.)
Thanks in advance if anyone can help.
Dell Axim x51v WM5 (if it matters)
p.s. Thanks to Vijay555 for "permitting" this post here, and for putting me on the track of WM_HSCROLL (which I haven't had a chance to study yet).
Guys, just to say, there's never any reason to ask me for permission to post. As far as I'm concerned, post whatever you want using your own good sense!
pro-fit2:
Try something like this, as we discussed in the other thread:
Code:
//get current foreground window
HWND CurrentForegroundWindow_hwnd;
CurrentForegroundWindow_hwnd=GetForegroundWindow();
SendMessage (CurrentForegroundWindow_hwnd, WM_VSCROLL, SB_PAGEDOWN, 0);
V

HOWTO: programmatically pop up soft keyboard

Hi,
I want to programmatically make the soft keyboard show up on my device.
I am using eVC++ 4.0. Any Ideas?
Mohammad.
mohgdeisat said:
Hi,
I want to programmatically make the soft keyboard show up on my device.
I am using eVC++ 4.0. Any Ideas?
Mohammad.
Click to expand...
Click to collapse
Code:
SIPINFO si = {0};
si.cbSize = [COLOR=Blue]sizeof[/COLOR](SIPINFO);
SHSipInfo(SPI_GETSIPINFO, 0, &si, 0);
si.fdwFlags = SIPF_ON|SIPF_DOCKED;
SHSipInfo(SPI_SETSIPINFO, 0, &si, 0);
Code:
SHSipPreference(m_hWnd, SIP_UP); [COLOR=Green]// for a specific window (to use in focus events)[/COLOR]
Cheers,
.Fred
Thanks Fred, this really works perfectly...
I am happpy now
Mohammad
dotfred said:
Code:
SIPINFO si = {0};
si.cbSize = [COLOR=Blue]sizeof[/COLOR](SIPINFO);
SHSipInfo(SPI_GETSIPINFO, 0, &si, 0);
si.fdwFlags = SIPF_ON|SIPF_DOCKED;
SHSipInfo(SPI_SETSIPINFO, 0, &si, 0);
Code:
SHSipPreference(m_hWnd, SIP_UP); [COLOR=Green]// for a specific window (to use in focus events)[/COLOR]
Cheers,
.Fred
Click to expand...
Click to collapse
hopefully this question is astute enough to keep from being flamed, but what the heck, nothing ventured, nothing gained....
so, if i took this line of code:
SHSipPreference(m_hWnd, SIP_UP); // for a specific window (to use in focus events)
and modified it something like this:
SHSipPreference(m_hWnd, SIP_DOWN); // for a specific window (to use in focus events)
or some such, could i then set it to keep the soft keyboard from popping up (either programatically or globally) without selecting it from the input menu?
obviously i know little of programming, but you should be able to catch the logic behind it. as to why, people are all but begging for this functionality for their Wizards....
blazoner said:
hopefully this question is astute enough to keep from being flamed, but what the heck, nothing ventured, nothing gained....
so, if i took this line of code:
SHSipPreference(m_hWnd, SIP_UP); // for a specific window (to use in focus events)
and modified it something like this:
SHSipPreference(m_hWnd, SIP_DOWN); // for a specific window (to use in focus events)
or some such, could i then set it to keep the soft keyboard from popping up (either programatically or globally) without selecting it from the input menu?
obviously i know little of programming, but you should be able to catch the logic behind it. as to why, people are all but begging for this functionality for their Wizards....
Click to expand...
Click to collapse
The SHSipPreference(m_hWnd, SIP_DOWN); is normally used when you catch the WM_SETFOCUS/WM_KILLFOCUS of a specific window. This is the normal behaviour for EDIT controls on pocket pcs that do not have an integrated keyboard. I can imagine it is a burden on the Wizard...
If you want to control the behaviour of the virtual keyboard for all controls of the active window, I should consider to use the first code.
You can also hide the sip button appearing on the soft keys bar, when you use the SHCreateMenuBar api.
You can also show a window with the sip down with the SHInitDialog api.
ps.: if you want to control the SIP of the whole system, you have to subclass the window with the classname MS_SIPBUTTON.
Cheers,
.Fred
.Fred
Now I leave myself open for flaming, the way I read this:
On a wizard that has a keyboard that is open and i am using, there seem to be many application that do not relize this and thus pop up the soft keyboard.
Is there a application that will stop this on a global bases ? (as in trick the applications into thinking my soft keyboard is my hardware keyboard or on call just closing the soft keyboard)
If so were can I get it from as I cant program my VCR let alone my 8track.
Well maybe reading is not my strong point but I feel that there might be a need for a .fred kbd (on / Off) tool.
Myself I have a BA with a hardware Keyboard that I NEVER use so I am not sure how apps react.
PS no offence intended
MDAIIIUser said:
.Fred
Now I leave myself open for flaming, the way I read this:
On a wizard that has a keyboard that is open and i am using, there seem to be many application that do not relize this and thus pop up the soft keyboard.
Is there a application that will stop this on a global bases ? (as in trick the applications into thinking my soft keyboard is my hardware keyboard or on call just closing the soft keyboard)
If so were can I get it from as I cant program my VCR let alone my 8track.
Well maybe reading is not my strong point but I feel that there might be a need for a .fred kbd (on / Off) tool.
Myself I have a BA with a hardware Keyboard that I NEVER use so I am not sure how apps react.
PS no offence intended
Click to expand...
Click to collapse
I think different solutions are possible for this:
1) I know somebody developed a NULL virtual keyboard (no layout), so whatever happens, the keyboard will never show up on the screen.
2) The SIP is a driver, so if it is unloaded, the soft keybard will never show up on the screen even when clicking on the keyboard button on the softkey bar, BUT I don't know what will happen with the hard keyboard, will the keys still be handled? It should but... (I can't try, I don't have a hard keyboard)
3) As you suggested a background program that would handle the on/off SIP behaviour on demand.
For me, the easiest would be the second option, because you just unload a driver, so no harm is done and no extra hack is made.
Cheers,
.Fred
3)
Well 2 sounds fine but can "joe blow" do that.
Myself I like to 1.
I see a cab that installs GhostKbd, ....
a null keyboard that can be chossen as the "input methord" over keyboard icon bottom right, options.
This gives the user the chance of having it when he wants nothing or not have it when he wants something (wiered looking at it that way).
This also wont conflict with what ever the Hardkeyboard does (well I think any way).
Can you talk to "somebody" and get it ?
Maybe we could have soem input from those that have the problem.
EDIT and 3 but could be some work
MDAIIIUser said:
Well 2 sounds fine but can "joe blow" do that.
Myself I like to 1.
I see a cab that installs GhostKbd, ....
a null keyboard that can be chossen as the "input methord" over keyboard icon bottom right, options.
This gives the user the chance of having it when he wants nothing or not have it when he wants something (wiered looking at it that way).
This also wont conflict with what ever the Hardkeyboard does (well I think any way).
Can you talk to "somebody" and get it ?
Maybe we could have soem input from those that have the problem.
EDIT and 3 but could be some work
Click to expand...
Click to collapse
Here is a free app, that does that!
http://personales.ya.com/beemer/nullkeyboard.htm
Cheers,
.Fred
@ blazoner
So does the above solve your problem and if so should we post it in the wizard wiki ?
i'm not sure. i had a cab file not uninstall completely, and it was interfering with my SIP options. i'll give it another go after a hard reset/rom upgrade. should know by tomorrow.
looks like there's a solution out there after all....
i found this in this thread http://forum.xda-developers.com/showthread.php?p=918794#post918794
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#3 07-04-2006, 04:50 PM
mistrix Join Date: Nov 2005
Posts: 10
Hardware Keyboard only in Landscape
--------------------------------------------------------------------------------
On the Universal the combination of PQZ (to assign different SIPs to landscape and portrait, should work on other devices too) and PHMs "NoDoSIP" (registers a SIP that does nothing) works perfectly. Disable all SIPs not needed at all by setting the Reg Value (search for the SIP by name in the registry) Default under IsSIPInputMethod for that method to 0. You can rename your remaining SIPs there as well.
__________________
MDAPro, HBH662
Click to expand...
Click to collapse
so far it seems to work on my 8125
i've still gotta go through and delete SIP methods from my phone (just cause i'm a perfectionist....)
if it works all through the weekend, i'll post it to the wiki....
still working great! posted to the Wiki!
Can you add the wiki link just in case somebody uses search and finds this thread.
MDAIIIUser said:
Can you add the wiki link just in case somebody uses search and finds this thread.
Click to expand...
Click to collapse
Sure! It's on the main Wiki page for the Wizard.
Enjoy!

User interface yrgo 2.3 beta 5

Hi guys,
I have released new yrgo 2.3 beta 5 so you can check it out on my forum here.
If you are new in yrgo - yrgo is highly customizable User Interface Shell written for Windows Mobile 5/6 Professional devices. It allows much more that any other Shell and goes more deep into the system - the memory footprint is also held low.
I highly recommend to see the presentation video (the video was recorded with older version - doesn't have as nice graphic as it is there now and it has much less functionality, but it is good to understand yrgo's concept).
So let me know what do you think .
UPDATED: There's a bug in the version I linked to my forum - it has only Czech version. Please scroll down the thread there, download English.zip a follow the instructions in the post to get the English version working. Sorry for that.
Regards,
Luky
Oh yes,
the gadgets for almost all resolutions are not arranged properly - it is still the beta version and I will work on this this week.
But you can of course easily re-arrange it however you want very easily (just check the video I have mentioned above).
Thanks.
Luky
it is really nice and fast. on start up there was too much gadgets on screen, I would say try to make the desktop really clean aligned properly on startup. but it's a good work you're doing.
I'm not sure if this is a bug: using the file manager to explore my windows directory seems to hang the app, or maybe my windows directory is just really big. after it hanged and I terminated it manually, the app still populated my top and bottom bar, and half my screen, I had to soft reset.
plus how to change background?
Hi,
thanks for your feedback. I'll check out the problem with Windows folder.
To change the background image, just find such image in the yrgo's file explorer and use Context menu and scroll down to get ability to use such image as a desktop background.
Regards,
Luky
I really like your app. your design mode is very innovative, resizeable icons, etc.
*why the "hide" button? after going deep in the settings and want to go back to the home screen I had to click back button all the way back to home. it is possible to make the hide button "home" button so one click will bring me back to home? I know I can click on an empty spot and it will bring me to home, but I don't think everyone will know that.
*when not in full screen mode some of the icons/info is cut off at the bottom because the icons\layout doesn't resize accordingly.
*is it possible to add the "running applications" button as a gadget?
*also could there be some transition effect from desktop to desktop?
know I'm asking for a lot but I wouldn't be saying anything if I didn't like the app.
Hi,
thanks for your feedback. It's ok, your questions are really relevant and helpful for me.
Yes, you're right. It makes more sense to have button "Home" instead of "Hide". I'll change it.
I know about the problem when switching off the full screen mode. The previous version had auto-rearraning the gadgets but it made a big mess when you switched from landscape/portrait mode so I temporarily removed it.
Yes, running appliactions can be add to the desktop easily - as any other item in yrgo - just 'tap and hold' on the Running application icon a use "Add to desktop"
Yep, some transition effect would be nice - but at this moment it is not my priority. I need to release current 2.3 as soon as possible. After that I'll start to think about new feature.
Again, thanks a lot for your feedback- it was very helpful.
Regards,
Luky

[Q] Can We Hide The Status Bar?

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

[Q][solved] Beginner problem with OnCreateOptionsMenu

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

Resources