How to create main menu layout like Robo Defense? - Android Software Development

First of all, I'm sorry if this is in the wrong section. I posted this to androidforums too but it seems the topic was complicated so people didn't even bother to answer my thread.
Hi, I'm new to android. I am used to code in C#, and I'm also developing an application for Windows Phone 7. I found out that creating a simple layout in android took a lot more of effort comparing to Windows Phone 7.
I'm going to create this main menu layout that looks similar to Robo Defense's main menu (the menu where you choose to start game, view achievement, etc).
note: I already added the landscape screen orientation and the fullscreen mode to the AndroidManifest. xml.
If you have already played robodefense, you can understand what menu that I'm talking about.
It was easy to create that kind of main menu in Windows Phone 7, but I had difficulties in Android when trying to design it from the main xml file.
I was thinking of using a LinearLayout, and then put a TextView inside the LinearLayout. And after that, I put a TableLayout for the buttons under the TextView. What bugs me is that the table didn't show up, only the text view was displayed.
Then I changed to using LinearLayout again but then put a TableLayout, then put the TextView inside the TableLayout (into a TableRow), hoping that it would be centered inside the table above the buttons. The result is still bad.
The "Title Bar" isn't centered inside the table, and the table layout creates a tablerow with two elements, one of which is empty, and the rows below it change their widths to fit the rows above them.
So that's it, i'm stuck here. What should I do? Any help is appreciated, thank you

Related

How to change start menu colour/image on Universal?

Okay, so I've trawled the net in search of a definitive answer to this, and I know it has something to do with the tdyater image file, but I can't get mine to change.
To cover my back I decided to make the file in 3 different formats, and with 3 different names. So in my windows folder I now have:
tdywater.gif
tdywater_480_640.gif
tdywater_640_480.gif
tdywater.jpg
tdywater_480_640.jpg
tdywater_640_480.jpg
tdywater.png
tdywater_480_640.png
tdywater_640_480.png
And still the background of the start menu is just clear, with my background picture visible underneath. This isn't helpful since my background image is very busy and no font colour can make the menu clearly visible. Is there a certain size the image has to be? I'm trying to use a 640x640 image. And is there anything I need to alter in the registry to make the picture appear?
Basically I am trying to use a plain white image, so would also be happy if someone could inform me of a registry key that can change the colour of the start menu.
Thank you
Hi,
tdywater = Today screen picture
stwater = Start menu picture
My start menu picture is a darkened version of the picture I use for my today screen but you can have anything you want.
G
I have to disagree. Though that would be logical based on the file names, I have just done a little test, and my today screen background is governed by stwater_480_640.jpg (for portrait) and stwater_640_480.jpg (for landscape).
If I rename those files to tdywater, then the default windows background appears. And none of these files, be it stwater or tdywater have any effect on the start menu at all.
I sense something odd i happening with my device, since the way you said it sounds like it should be right.
But having said that, I did originally read somewhere (think it was ppcsg) that the correct filenames for portrait and landscape backgrounds were the ones I am uing, hence why I use them, and hence why they work. So basically it's just the start menu I'm struggling with.
I quote from "How to Create an Extended Theme" from Spb Pocket Plus:
http://www.spbsoftwarehouse.com/products/pocketplus/themetutorial.html?en
# Select your Today screen image (tdywater.gif) from the folder you created. Press Next.
# Select your Start menu image (stwater.gif) from the folder you created. Press Next.
These have been the standard filenames for the images for as long as I can remember...
G
gquipster said:
I quote from "How to Create an Extended Theme" from Spb Pocket Plus:
http://www.spbsoftwarehouse.com/products/pocketplus/themetutorial.html?en
# Select your Today screen image (tdywater.gif) from the folder you created. Press Next.
# Select your Start menu image (stwater.gif) from the folder you created. Press Next.
These have been the standard filenames for the images for as long as I can remember...
G
Click to expand...
Click to collapse
Well bugger the standard. If you read my posts you will see that is not the case on my device. Suppose I'll just keep trying
Are you just copying the images onto the device or using a TSK theme file?
I could never get it to work just copying the images.
This was the program which was recommended to me for building TSK files:
http://www.codeppc.com/telechargements/themegence/themegence.htm
Or do what I did for my first theme and use a CAB editor and just change the images in an existing theme
Not doubting you that it's not working on your device, just not a lot I can do but offer you the information which I have.
Hope this helps
G
Found a way round it
1. Make the theme using the standard microsoft theme generator
2. Apply it on the device
3. delete tdywater.gif
4. Insert my own tdywater_480_640.jpg and tdywater_640_480.jpg files
5. Bingo!
Only thing is, I have to re-do most of that (from step 2 onwards) every time I soft reset, because by default my universal is showing stwater as the background image (ie: a think white bar which I have as my start menu background). It only recognises tdywater after applying a theme
Just use Wisbar!! :lol:
GaZ said:
Found a way round it
1. Make the theme using the standard microsoft theme generator
2. Apply it on the device
3. delete tdywater.gif
4. Insert my own tdywater_480_640.jpg and tdywater_640_480.jpg files
5. Bingo!
Only thing is, I have to re-do most of that (from step 2 onwards) every time I soft reset, because by default my universal is showing stwater as the background image (ie: a think white bar which I have as my start menu background). It only recognises tdywater after applying a theme
Click to expand...
Click to collapse
Thanks

[Q] Android Design Principles

Been looking over Android design principles, especially how you shouldn't have to do anything from a Context menu but its just a nice feature.
In other words, this says to me, everything is a child and if you drop down far enough, you should be able to delete the item.
Ok...
Then I got a problem.
I got a situation like:
Grandparent > Parent > Child
Each one is essentially in a list view, but in my situation, you cannot add the child until the parent is saved (Row Ids in a database and all that) and we really don't want to do any editing of the parent. But we have several actions we might like to accomplish - hold/freeze/extend... that kind of stuff.
Given that context menus aren't desirable, would we perhaps just put all the actions on the "Parent" activity with a link to the Child form?
I hope that makes sense?

[Q] list selector menu

I have designed a new menu for my app, that i think is more appealing than the regular android "six pack" menu and as such uses none of the menu xml attributes and is purely designed in the java and layout file.
However one of the options requires a list, and instead of bringing up an entire new activity, i would still like to use the sub menu list type, is it possible to do this from a onClick case? if not can anyone suggest an alternative way to get a similar result?
all help is much appreciated thanks

[Q] Getting a button to funktion

Hi
im making this app where I want a list of stores divided into catagories such as: electronic, food, clothes. My problem is that I cant get figure out how to add a button, which should be clickable, and when the user clicked it, all the stores in that category would appear? I'm using Eclipse.
PS im a rookie a in developing apps
Hopes someone can help me.
Do you want to filter a single list in one activity depending on what button you click or just load a new activity with just that content in it?
Either way you will need a layout with a button in it and then you will get a reference to that button in your activity and then setOnClickListener() to it and define an action to take when pressed.
There are some good "Button Tutorials" on the android developer site as well as other places around the net
From something awesome
IMO, the quickest way is to toss the list in an array and load-up a ListView. Then setup a listener and use onItemClick().

[WebTop]-[How To] Create shortcuts to custom phone actions on Webtop

I looked around and couldn't find a detailed guide on how to do this so I figured it out and decided to share..
Prerequisites:
Working Webtop
XFCE Desktop
or
AWN Manager
aLogcat > https://market.android.com/details?id=org.jtb.alogcat&hl=en
This is a simple proccess which will require you to use aLogcat to get the activity name of the item you want to launch and then simply make a new shortcut item on your launcher.
Getting our activity name:
Launch aLogcat
Hit the menu button on your phone
Select Filter
type "activityMan"
leave the option for regular expression unchecked
--Now that your application is logging and filtered you will see a window with alot of text. This is where we will be searching.
hit your menu button again
Select Clear
Now hit your home button and navigate to the icon you would like to be able to directly launch from your webtop and click it.
Go back to aLogcat
Hit the menu button on your phone.
Choose the pause option from ALogcat
***Now were going to search for the string we need to tell activity manager which activity to launch**
Look through your log for something that looks like this: "com.p1.chompsms/.activities.ConversationList" (this one will launch ChompSMS)
In my case the entire line looked like this: /ActivityManager( 1700): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.p1.chompsms/.activities.MainActivity bnds=[5,343][115,483] } from pid 3088
copy the string that comes after "cmp=" (bolded above)
Creating the shortcut
Depending on which interface you are using this will differ slightly:
For AWN Manager
Open AWN Manager
Choose Launchers
Click Add
Set your name description and Icon
For Command add the following: androidlauncher --action "android.intent.action.MAIN" --cmp "<TEXT THAT YOU COPIED ABOVE>"
For XFCE
Right click on the task bar.
Choose "Customize Panels"
Next to where it says Panel 1 hit the + button to create a new Panel.
**Select the new panel and edit its options**
Set it to Normal Width | Fixed position | And then select the position where you would like to see it on your screen.
Change icon size to suit your taste. (Tip, if you would like to use the icon for the application an easy way to get it is to Google "AppName icon" and then use Google's image search. Choose an icon that's somewhere near 96*96 (you can sort by size), save it and select it from the menu.
Now that we have created a shortcut / panel
Right click the new panel / Icon
Add new Items
Launcher
Set your name description and Icon
For Command add the following: androidlauncher --action "android.intent.action.MAIN" --cmp "<TEXT THAT YOU COPIED ABOVE>"
you now have a working shortcut that will pull up the app or activity in "Mobile view" on your webtop!
Yay.
If anyone knows any more tricks with this please let me know! I have been wondering if it is possible to tell the app to come up in full screen.
** if this helped you please remember to hit the thanks button (help a guy boost his newb cred) **
Thanks for this. You probably saved me a lot of time because I was going to try to figure out how to do this.
Have all the apps on the phone worked without problems?
Also, does the Entertainment App work thru XFCE Desktop without the Awn dock?
blingmaster said:
Thanks for this. You probably saved me a lot of time because I was going to try to figure out how to do this.
Have all the apps on the phone worked without problems?
Also, does the Entertainment App work thru XFCE Desktop without the Awn dock?
Click to expand...
Click to collapse
I haven't tested enough to say whether everything works or not. I also haven't eve used the entertainment center . This was one of the primary reasons why I was frustrated with the original webtop. They gave use the ability to launch only a couple of their apps rather than just creating a mechanism for us to select apps for shortcuts. This is something I may look into developing in the future.
Awesome work! I was just going to look at this today after looking at XFCE menu editing yesterday and BAM you already did it!
Too bad I broke my webtop somehow and had to start over this morning. I'm getting so practiced I could do it in my sleep!
Upon further thinking, you could probably just create a .desktop file like the other ones have and then it would automagically get put in the XFCE menu. Then it could be scripted and added into webtopscripts or something.
stewartsoda said:
Awesome work! I was just going to look at this today after looking at XFCE menu editing yesterday and BAM you already did it!
Too bad I broke my webtop somehow and had to start over this morning. I'm getting so practiced I could do it in my sleep!
Upon further thinking, you could probably just create a .desktop file like the other ones have and then it would automagically get put in the XFCE menu. Then it could be scripted and added into webtopscripts or something.
Click to expand...
Click to collapse
Last night was my first night with a working webtop, being able to quickly launch ChompSMS , or pandora on my mobile view was top priority for me. Now that I have that mostly handled I guess I need to move on to learning XFCE tweaks. I'm really glad this helped, I was really surprised that this wasn't already hashed out and detailed, but I was glad to finally be able to contribute something over here!
Hi nineismine,
Mind to provide me a little bit of extra info on the below? Thank you in advance.
(1) How to "remove" the pre-installed short-cut apps in mobile view? For example the "Messaging". I rather prefer to replace this with the "Text Messaging" by following your tutorial.
(2) How to "remove" the pre-installed short-cut apps in webtop view? For example, mine Atrix is Asia Retail version and it build-in with the "Motorola Video" app-tray which I have no idea how to "remove" it.
I herewith attached the screenshot on my stock webtop for your reference (the stock webtop do support screenshot feature and I learn this from this link: http://forum.xda-developers.com/showpost.php?p=17093665&postcount=3)
Edited:
I found my solution by installing the webtop2SD. My issue solved. Thanks.

Categories

Resources