Game Menu - Java for Android App Development

Hi,
I recently started Android game Development and I Was wondering how to create a menu for a game with a step by step process? Im using Eclipse .
Regards,
tripplemin

I would use buttons that open each activity.
In an XML file just put whatever buttons you need (eg: Start Game/Options/High Scores)
In your Java file set each button with findViewById and set OnClickListeners for each to open up the activity that corresponds with the button.
Then you may want to use drawables to create a background or something to make it look better

What's your problem with Acella's answer ?
Do you mean a menu shown by hitting menu button ?
Or do you know how to add a button ?
These are two good references :
http://www.mkyong.com/android/android-button-example/
http://thenewboston.org/watch.php?cat=6&number=9

Related

Changing "Programs" link in Start Menu

Hi All,
I was wondering of there's a way to change the Start menu or the "Programs" Link in the Start Menu to open another application. I want to develop something like gStart, but for PocketPC (on smartphone u can change the a registry key to set another application as the default app when u click "Start" button). Mio A700 screenshots has a gr8 MioMenu very nice and sexy so i want o do something like that.
thanks for your help
On PPCs the start menu works like in regular windows – there is a folder ("start menu") under windows with all the shortcuts. You can change the files there, create subdirectories etc.
You can also catch the taskbar window (class "SS_TASKBAR I think…) and just cover the start button with your own window.
Hope this helps.
you must edit the shellres.dll file , in this file has the path to the "programs folder"
I think he was pertaining to a custom "programs menu" like calling for example folderview.exe and not the Path or not where the folder is being called.
A programs menu replacement instead of using the defualt one.
I actually saw an app like that some time ago, it was very small like a few kb and just lied in the background waiting for you press the start and when you did it launched an app of your choice instead of showing the start menu...
Don't remember the name though : / think it was based on something called green button or something which is basically the same thing but for the call button... maybe you should around some, or hopefully someone knows what i am talking about and can give you a link
Leonick said:
I actually saw an app like that some time ago, it was very small like a few kb and just lied in the background waiting for you press the start and when you did it launched an app of your choice instead of showing the start menu...
Don't remember the name though : / think it was based on something called green button or something which is basically the same thing but for the call button... maybe you should around some, or hopefully someone knows what i am talking about and can give you a link
Click to expand...
Click to collapse
This one:
http://forum.xda-developers.com/showthread.php?t=486712
You could add a shortcut to any other folder and then hide the programs link. To do this, set the Programs folder to hidden.
allelimo said:
This one:
http://forum.xda-developers.com/showthread.php?t=486712
Click to expand...
Click to collapse
Yup pretty much like that, but except for the Start or Windows Start, the "Programs" with in the start menu is being intercepted and launching an alternative "Programs Menu"
I guess the only way is to make an ordinary Start Menu replacement (same as the defualt Start Menu) with the exception of having the "Programs" launch another program.
This way, looks and feels of WM is still the same.

Simulate touchscreen tap, or add ShortCut key.

Hello,
I have such a problem. But first I will explain why I have that problem.
In company we are using a PocketPC with Windows Mobile 2002. And have only one apllication for work.
When connecting to Server we need to tap the left bottom corner of the screen.
Many of workers tap with diferent objects like cutters, pens, not with Stylus, so the left bottom corner become bad in 1-2 months, till the time I can't do nothing, just changing the screen.
So. There is a posibility to implement somehow a ShortCut to that menu, to avoid taping that part of screen? (Because after that in program we use only buttons.)
(Note: I have no source code for tha app.)
Any kind of help will be apreciate.
Thank you much!
It's easy to simulate screen tap by code.
Do you have experience programming in C/C++?
If so all you have to do is write a little app that does the following:
Code:
HWND hWnd; //window handle
hWnd = FindWindow(L"BUTTON", L"Connect to server"); //this text is just an example
SendMessage(hWnd, WM_LBUTTONDOWN, 0, MAKELPARAM(5, 5)); //actually simulates the click
Then you can assign this app to a hardware button using device settings or put a shortcut to is in the start menu.
I don't know of any ready apps to just simulate a click, but there was a thread around here somewhere on a virtual mouse app for PPC. It's free so try searching for that. (Sorry, don't remember the link).
Good luck.
Thank you man.
I'll try this...
levenum said:
It's easy to simulate screen tap by code.
Do you have experience programming in C/C++?
If so all you have to do is write a little app that does the following:
Code:
HWND hWnd; //window handle
hWnd = FindWindow(L"BUTTON", L"Connect to server"); //this text is just an example
SendMessage(hWnd, WM_LBUTTONDOWN, 0, MAKELPARAM(5, 5)); //actually simulates the click
Then you can assign this app to a hardware button using device settings or put a shortcut to is in the start menu.
I don't know of any ready apps to just simulate a click, but there was a thread around here somewhere on a virtual mouse app for PPC. It's free so try searching for that. (Sorry, don't remember the link).
Good luck.
Click to expand...
Click to collapse
So I have not so many experience in C++ and nor in Visual Studio.
Can you provide me with full c++ code for Visual Studio 2005?
Thank you in advance.
Here is another way. Just create a simple project in vis studio ( I am not using 2005 so I cant tell you what its called, if all else failes use the "hello world" option). Open the main .cpp file and after the includes delete everything. Paste this in....
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
mouse_event(MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_ABSOLUTE,61439,1638,0,NULL);
return 0;
}
Then build the exe. Make a shortcut to the exe on your device and place it in the windows\start menu folder. When the user taps the shortcut the cordinates specified will get a mouse down message, not all ppc programs will rspond to this message but most bought software I have do.
As it is, this will hit the close button on a 240*320 display. To vary the target location see this from the documentation:
If MOUSEEVENTF_ABSOLUTE value is specified, dx and dy contain normalized absolute coordinates between 0 and 65,535. The event procedure maps these coordinates onto the display surface. Coordinate (0,0) maps onto the upper-left corner of the display surface, (65535,65535) maps onto the lower-right corner.
...So you may need to play with it to hit the spot.
If that fails then just replace the
mouse_event(MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_ABSOLUTE,61439,1638,0,NULL);
with levenum's code putting the name of the window you are talking about in instead of "Connect to server" to send the normal WM_LBUTTONDOWN message to that window.
OdeeanRDeathshead, your method seems to work. I did it and application works proprely on my Magician.
But now the question is: I need that program for a PocketPC 2002 platform. How to do this in VS2005, can explain me anyone?
Thank you in advance.
Actually, you can't write apps for WM2002 using VS2005.
You need eMbedded Visual C++ 3. It is available free from Microsoft, just search the site. You will also need to install Pocket PC 2002 SDK. (also free on MS site)
levenum said:
Actually, you can't write apps for WM2002 using VS2005.
You need eMbedded Visual C++ 3. It is available free from Microsoft, just search the site. You will also need to install Pocket PC 2002 SDK. (also free on MS site)
Click to expand...
Click to collapse
Ok.. all this I installed.
I will try to do the program there. But problem become more complicated.
My PDA's are not HTC. They are modified by SYMBOL company. So.. I realized that i have no HARD BUTTON.
In start menu I can't let the application, only because START is not accessible. The only program is that for work and it's full screen.
The PDA have a keyboard.
The question is: it is possible to do in program a HOT_KEY combination, and run MOUSEEVENTF_LEFTDOWN only when HOT_KEY combination was pressed.
I understand that program must remain in memory to intercept that.
Do you mean that there are no buttons on your device, only a keyboard?
Doesn't matter really because as far as windows is concerned keystrokes from device buttons and full keyboard are handled the same.
Sorry I am not really familiar with setting up hot keys, I think your app window needs to have input focus for that to work.
There is a function called SetWindowsHookEx that lets you hook all keyboard events so they will pass through your function. You can then have a small app in background (without UI) that will monitor any key combination you want and simulate the tap when necessary.
levenum said:
Do you mean that there are no buttons on your device, only a keyboard?
Click to expand...
Click to collapse
Yeah.... it looks like this http://www.symbol.com/PDT8100
I do not know if you can throw some cash at your problem but SKScHeMa from www.s-k-tools.com can wait for an application to start then execute a script. In the script you can simulate both tap and tap and hold actions.
Hope that helps.
Regards cjb.
One of those buttons must correspond to the buttons on the normal ppc. It would be overkill too write an app to run constantly just to redirect one tap. Do you have the opportunity to ever start the unit without the fullscreen program running, if so you could experiment with the button assignments to find the correct one. If the author of the custom software on the thing was half good they could have disabled those buttons assignments while its running, but if they didn't thats the best solution.
If that fails perhaps a program to run after powerup and ask if the user wants to connect to the server could work. It could show for 10 seconds then end. There was a thread here somewhere about programs starting on powerup but I can't seem to find it now.
edit:
I read the specs and it has two "side scan keys", I bet they are your buttons waiting to be reassigned!
OdeeanRDeathshead said:
One of those buttons must correspond to the buttons on the normal ppc. It would be overkill too write an app to run constantly just to redirect one tap. Do you have the opportunity to ever start the unit without the fullscreen program running, if so you could experiment with the button assignments to find the correct one.
Click to expand...
Click to collapse
No one of that buttons corespond to CALENDAR or CONTACTS or CAMERA or RECORD button.
I can start the device without work program. Also I don't need to simulate tap, because I own my PDA and have knoweledge how to use it.
Users don't know much... for that i disables all. Only Work program in fullscreen mode without START MENU.
I read the specs and it has two "side scan keys", I bet they are your buttons waiting to be reassigned!
Click to expand...
Click to collapse
This is a PDA with barcode scanner. That 2 buttons named "side scan keys" are only for SCANNER and are not programable.
TO ALL: Thank you for your support![/quote]
cjb said:
I do not know if you can throw some cash at your problem but SKScHeMa from www.s-k-tools.com can wait for an application to start then execute a script. In the script you can simulate both tap and tap and hold actions.
Hope that helps.
Regards cjb.
Click to expand...
Click to collapse
Thanks for help.
I can't do any investitions in that.
More of that it's not the same I need. I need to simulate this not only at start, also during work.
Yes, so make the prgram asking if a connect is needed run when the power button is pressed. If the user needs to connect they press off then on then the window comes up asking if a simulated tap is needed (I do not mean reset). If the full off is not desireable then dose your unit change the brightness when the power button is held down? If so, and if it is using the standard name for the named event to signal brigtness changes then you could make the tap simulate program run all the time in a loop but waiting for the brigtness change event. Waiting will take up almost no processor time and the program is so small it takes up almost no memory! The user just has to hold the power button for several seconds and the your window will pop up. The down side is that your app will also have to save then restore the brigtness settings so the user dose not need to manualy reset the brigtness level.

where does the list of programs--> button comes from?

I'm writing a script using Mortscript, and I would like to assign it to a button.
When I go in the proper menu (Buttons), I have a list of programs.
Now, some of them are script files, but not all of them.
How can I have my script listed there?
What kind of programs are listed in that pop-up menu?
Suggest that you copy your script file & paste a shortcut in Main memory\Windows\Start Menu, it will then appear in the list of programs you can run via Programs on the Today screen as well as the place you want it. Please remember to paste a shortcut not the actual file.
You can also re-organise the Start Menu items by creating folders & moving the shortcuts into them, it saves having to scroll through long lists of icons. I have folders for things like utilities & games.
Mike
thanks Mike,
this is something I've done for a long time, and I agree it's useful.
But my aim here is to use one of the hard buttons (the video calling one) to substitute the on-off button on the left. The reason is simple: I prefer to use my right hand.
That's why I wrote a Mortscript file to do that.
Now how it is some mscr files can be seen by the "assign button" routine and others can't?
File dimension? Use?
No idea.

HButton for smartphone

Hi,
I created HButton for smartphones. BUT I have no smartphone so I developed it on smartphone emulator.
I will be very gladly, if there is someone who can test it.
Please note: Test it on your own risk - never been run on real smartphone.
thanks
Hundera
Great! While I have no time to test it right now, I'll frontpage the news if it turns out to be working!
when i get to the assign window, i get stuck there, don't know what's the next step
oldsap said:
when i get to the assign window, i get stuck there, don't know what's the next step
Click to expand...
Click to collapse
Hi,
I created it little messy. It has to be changed before official release.
* Using * assign it to any HW button. I don't know if there will be name and icon of selected button or just something like "unknown 40C1".
* Create list of applciations
* Left and right button select preferred application​* enter to add it to list​* Press OK.
thats all. Now you should be able to start application using HButton....
What now?
I managed to do almost everything:
I assigned applications to the list of button1,
I clicked on '*', and so
Assigned to (*) displays "Unknown 40C1"
When I run the application Button1 manually, the application I chose for Button1 is run.
But what now? What do I have to press to make the application run? What is button1? I tried all buttons, pressing for various lengths of time, but I can't get it to run.
Do I need to edit the registry so that the application "Button1" is assigned to some button?
Hi,
at first thanks for help.
"Unknown 40C1" means - there are registry part about this button. In SPh, there's missing names of buttons - so name is unknown.
I has no SPh, only emulator. I checked registry and there is all ok - only names are missing. All flags and path to applications that should be started are similar to pocketpc.
These registry settings are altered by my program so HButton1 should be started by button with code "40C1". What button it is - I really don't know. That's what I need to test.
But as you describe it, it looks like that these settings are ignored.... So Where is settings of button's behavior on smartphone?!?!
ghostwheel said:
I managed to do almost everything:
I assigned applications to the list of button1,
I clicked on '*', and so
Assigned to (*) displays "Unknown 40C1"
When I run the application Button1 manually, the application I chose for Button1 is run.
But what now? What do I have to press to make the application run? What is button1? I tried all buttons, pressing for various lengths of time, but I can't get it to run.
Do I need to edit the registry so that the application "Button1" is assigned to some button?
Click to expand...
Click to collapse
not totally sure
I'm no expert in this.
If I understand correctly, one way to do it is through links in the \windows directory,
so
\windows\short_MSG
is a link to the program called when the message button is pressed
\windows\short_Camera, and short_IE
are for camera and explorer button.
But I think there are also other places to set these. And some phones allow long_MSG,IE,Camera links for long button press - not mine.
I tried to copy the Button1 link to short_MSG, and that managed to run the first command in the list for button1, but not the next on a longer press. (And it still launched the message program first, so there must be a second place that determines what is launched...)
Maybe people in the smartphone forum will have more info...
All this was on an s620 WM6.1
just a few more comments
Now that I can get HButton to partially run, I have a few comments:
I'm not exactly sure why, but going from HBSetup to configure buttons 1 and 2 takes a really long time. HButtonTask is much shorter. Maybe it is because a list of all programs is generated, and this takes time? In any case, maybe one could display a message "please wait..." - the first time I thought the program had crashed.
Pressing left (instead of right) when the bottom selector in HButton1 setup shows <None> crashes the program (ArgumentOutOfRangeException)
In HButtonTask setup there are two arrows below Custom delay (I think to chose the delay), but no number is displayed, and pressing left-right only toggles the boxes.
<Start Menu> doesn't work. <Clock>, <Toggle BT>, <Quit>, <Today> do work. <Back> behaves a bit differently than the Back key - it switches between tasks, instead of screens - but that's ok and can be useful!
In the HButton1/2 setup screens, I would change the left softkey to "save" instead of "ok". Too often I pressed that button instead of the center/enter button to change the action on the list. Because it takes ~10 seconds to enter the screen again, it is quite annoying....
Hi
I am really interested in this project if is still under developement

Fast Wireless control

Hi to everyone,
As You know guys, is there some easy way to swith on and switch off WiFi on HD?
I don't know, for example some tool to map a button hw like end key, instead of every time open Control Manager and waiting for it long response time to switched it on/off...
Thx
Woohoo I've finally found the ultimate solution. Download the program from the link below. unzip it . copy it to program folder on HTC root. Add a shortcut to the start menu (using resco explorer: file/send to/startmenu as shortcut). move it to the top of your drop down start menu &/or in settings, assign it to button 1 hold
http://ae.inc.ru/aewft.php
Or you could install AKToggleWiFi
http://forum.xda-developers.com/showthread.php?t=442727
see post above
Thank You so much guys for your advice.
:-D

Categories

Resources