Hi guys
I'm quite new at android developing and i'm really just playing around making things for myself
Right now i'm making an app with a settings menu that the user can set a variety of options.
One thing i really don't understand and i'm guessing i'm missing something basic here that everyone knows is how to create these menus
The type of menus i'm talking about can be found if you open the Internet got Menu > More > Settings
The menu style that you get is a standard one that can be found in heaps of applications however i can't seem to be able to google myself to how you create these
Thanks
Scott.
There is a subclass of the activity class called PreferenceActivity. Use it mostly as you would a regular activity class, but you can add predefined preference panels to the view. See the sample here:
http://developer.android.com/resour...ple/android/apis/app/PreferencesFromCode.html
Related
Hi. I'm using cLauncher and I'm wondering if there was a way to get things like phone settings, display settings as an icon setting on the Today screen. Going through menus is a bit slow for frequently used functions. Thanks.
There is a thread somewhere around here that deals with making shortcuts for items on your phones "control panel" I wish I could find it, but it's going to be a bit of a ***** to do so probably. If I do find it, I will let you know.
Curious D said:
Hi. I'm using cLauncher and I'm wondering if there was a way to get things like phone settings, display settings as an icon setting on the Today screen. Going through menus is a bit slow for frequently used functions. Thanks.
Click to expand...
Click to collapse
This might help.
You can use this cab to create a link to the today settings and then add it to cLaunch. It creates a link to start>settings>personal>today.
In order to link to things such as the backlight control enter \Windows\Backlight.lnk (note lnk is LNK in lower case) into the 'File Path' field within the cLaunch settings. You can also add custom icons as well - search google for suitable 32x32 icons and then convert them to bitmaps. They work a treat.
To find out other useful info about shortcuts check the following posts by vijay555: http://forum.xda-developers.com/search.php?searchid=507575
This link does not appear to be working - use advanced search using the word 'completeness' and the user id vijay555 which will return the required links.
They are very useful and informative. Vijay555 is also a fan of cLaunch from what I gather.
cLaunch is a great piece of freeware! I'd recommend it to anyone!
Ok, by now you probably know HTC's nice text selection tool. To use it, write some words in a HTC application (like the text message composer), then tap-and-hold somewhere in the text. You get one handle to move around, or two if you want to select a precise part.
But there's more. Change "HKLM/Software/HTC/TextSelection/EnableMagnifier" from 0 to 1. Now activate the text selection tool again as described above and try moving the single handle around...
Nice catch. Can be helpful in tight selections. I've been looking through the reg. So much stuff disabled... Why does HTC do this? They could've placed it as an option on SMS menu...
Thanks. Added to tips thread.
Maybe they disable it so we at XDA have something to do until HSPL is released
Some other simple but cool things I discovered:
* You can use the album app to crop pictures. Just pinch-to-zoom until the part you want fills the screen, then tap the screen, tap the icon on the bottom right and choose the second option from the menu. In Dutch it's called 'Schermafbeelding opslaan'. It will save a cropped copy of your pic.
* Here's a registry entry I found: "HKLM/Software/HTC/Manila/InternetPush/EnablePushInternet". It's set to 0 by default. I'm not really interested in push internet, so I haven't experimented with this, but it seems you can enable it if you want.
* Sometimes touch scrolling gets in the way of selecting text. If you want to select text, the solution depends on the context, but to start you just tap-and-hold anywhere:
-- In Opera, you can switch text selection on/off in the context menu;
-- In some apps (like while reading an e-mail message) you get a pop-up menu where the first option is 'make selection' ('selectie maken' on my Dutch device);
-- In Word, just before the pop-up menu appears, you see this: '[T]'. As soon as it appears, move your finger and you'll be able to select text!
* If you like the Footprints app but prefer full size pictures to those square 'polaroids', there's an option to save a full sized copy whenever you create a 'Footprint' (Footprints tab -> Menu -> Settings).
* The 'me' entry in the People app stores your 'owner' info. I know this is widely known by now, partly because I've been posting it everywhere, but I still see so many people complaining they can't register their applications (Resco stuff, SKtools)... because the can't find the old owner info icon. I have registered both Resco Explorer and SKtools perfectly fine without ever bringing the owner info icon back.
I haven't ever been able to get the Text Selection sliders to work on a custom rom even after setting the registry value to 1.
This is an awesome feature and I can't understand why it doesn't work.
leepriestenator said:
I haven't ever been able to get the Text Selection sliders to work on a custom rom even after setting the registry value to 1.
This is an awesome feature and I can't understand why it doesn't work.
Click to expand...
Click to collapse
you know it only works in text messaging, right? (well, some other htc apps too, apparently, but i couldn't name another one i've seen it in)
Yes of course... I'm aware that it only works in the realm of Sense specifically mail and text. I can do the standard selection thing but I just can't seem to get the sliders.
Any ideas?
hmm, well a common mistake I've come across a few times is people not pressing select the first time.
firstly go type some text into a new text message. (not sure where the idea it works in email came from, certainly doesn't on mine.)
ok, press and hold should bring up a cursor and the words "select|select all.
use the single sljder to set the start(or end, whichever) press 'select' nd now a second slider should join the first, enabling you to select.
Thanks for the responses guys, but as it turned out, I didn't realise that Energy ROMs are stripped of the HTC Messaging Module and that seems to be the only place where this 'feature' works.
It's a shame that's it's not available system-wide considering how easy it makes life.
I installed the HTC Messaging Client and voila, it was it there! but that excitement was short lived considering how bad HTC's messaging client is.
hah couldn't agree more. with the magnifier too its great ,, just never gets used.
Hi there chef's! I'm not sure if any of you will find this useful but I'll post it in case you do...
I designed this little mortscript application so that users of my rom can tweak a few settings to their needs and because all of the other tweak applications couldn't be tweaked easily themselves without learning .NET or something similar.
I wasn't getting much feedback so I thought perhaps it wasn't customisable enough or maybe you didn't like my selection of tweaks. Perhaps you thought the menu layout sucked?
Anyway, to address those problems I've moved this on quite a way. It now includes a set of functions for creating Menu's. To Find out how, see the section titled DynamicMenu.
FoddTweak
Backup and restore of important data (Full registry, Titanium configuration, Start menu cpr files, Start menu icon registry settings)
Icon removal to save RAM (all, or all but settings (HTC icons are excluded))
Titanium plugin injection/removal and plugin order settings
Slide lock settings (both manila and wm6.5)
Enable/Disable Sleuth's myLocation service (soft-reset needed)
Enable/Disable start menu replacements and complete removal of the WM6.5 start menu
FoddTweak depends on a few things:
MortScript! (tested on 4.3.b15)
DynamicMenu (included in versions>0.0.1)
TICS Installer (for plugin injection/removal, included in versions>0.0.1)
FDC task manager (for backup purposes, included in versions>0.0.1)
DynamicMenu
It works like this; the menu system 'compiles' a master menu source file with extension mgs to it's component mgc files for each menu. If you want DynamicMenu to 'recompile' then just delete the top level compiled menu (e.g. If you add new options to "FoddTweak.mgs" then delete "FoddTweak.mgc" then re-run FoddTweak.)
This is a sample file, which is used to create menu's for the FoddTweak application:
Code:
menu(FoddTweak:Main Menu)
item(Toggle Lock on Screen Dim:true:Call:"AnyRegWrite", "Toggle", "HKCU", "ControlPanel\Backlight", "AutoDeviceLockEnable")
item(Sleuth's myLocation Service:true:Call:"AnyRegWrite", "Toggle", "HKLM", "Services\myLocation", "Enabled")
item(:false)
menu(RAM Savings:RAM Saving Options)
item(Remove all Start Menu Icons:false:Call:"RmAllStartIcons")
item(Remove all but Settings Icons:false:Call:"RmAllButSettings")
item(Remove the Start Menu:false:Call:"RmStartMenu")
endmenu
item(:false)
menu(WM6.5 Settings:WM6.5 Specific Settings)
item(Toggle WM6.5 Slide Lock:true:Call:"AnyRegWrite", "Toggle", "HKLM", "Software\Microsoft\Shell\LockScreen", "Enable")
item(:false)
item(Titanium Plugin Injector:false:Call:"TitaniumPluginInjector")
item(Titanium Plugin Uninstaller:false:Call:"TitaniumPluginUninstaller")
item(Titanium Plugin Order:false:Call:"TitaniumPluginOrder")
endmenu
item(:false)
menu(HTC Sense:HTC Sense Options)
item(Toggle Sense 2.5 Slide Lock:true:Call:"AnyRegWrite", "Toggle", "HKCU", "Software\HTC\Manila", "Home.lock.Enabled")
item(Toggle Sense Menu Replacement:true:Call:"ToggleSenseMenuRep", "Toggle")
endmenu
item(:false)
menu(Backup:Backup Options)
item(Make Backup:false:Call:"Backup")
item(Select Backup Folder:false:Call:"SelectBackup")
item(:false)
item(Restore ZIP Backup:false:Call:"RestoreZIP", backupdir\"*.zip", "\Windows")
item(Restore REG Backup:false:Call:"RestoreREG", backupdir\"*.reg")
endmenu
endmenu
Syntax
It should be quite obvious how the menu/submenu entries work with a title and description-those can be nested without any problems (though, I only tested one nesting at present.)
Menu syntax is a little restricted, you can't have the colon (":") symbol in the name or description as it's used as a field delimiter and they must be string literals:
Code:
menu(name:description)
...
endmenu
For your menu items, the ItemName and Mortscript Command are string literals. Arguments which are not enclosed in double quotes will be interpreted as variables (I haven't tested this though,) which obviously must be set by the calling script before the call to DynamicMenu().
You can make use of any Mortscript function that the script which calls DynamicMenu() has access to and of course Mortscript commands such as "Run" etc will also work just fine so with this you can access any system command as well.
The testing field for the items is important, if your function supports taking it's first argument as the word "test" and outputting something, that something will be output in brackets next to the menu item. Sounds vague? Well, it is. That something can be anything, true/false, a string. Whatever. So the idea is that it'll be used to denote whether a switch is on/off or the value of that particular menu item...
Code:
item(ItemName:Can it be tested?:Mortscript Command:Argument1, Argument2, ..., ArgumentN)
To put in a seperator you can include a blank line in the menu using the code below. I wouldn't recommend it due to differences in screen size, but if you wanted a dashed line as the seperator, for example, then just fill the first field with hyphens. Seperators are as follows:
Code:
item(:false)
It's a v.simple language, I haven't included any comment support and it's line by line but see what you make of it
Interesting line of thinking. I like the idea of removing the SM icons. I will play with this and see what it can offer. Thanks...
sorry to bump this, but I've updated the menu compiler a little so it shouldn't be thrown off by menus or items which have parentheses in the name or description...
Plus, I added the menu option for the RAM savings again. Hope you like it.
arealityfarbetween said:
sorry to bump this, but I've updated the menu compiler a little so it shouldn't be thrown off by menus or items which have parentheses in the name or description...
Plus, I added the menu option for the RAM savings again. Hope you like it.
Click to expand...
Click to collapse
Very good idea, trying it now
ciao
Removing the reg is almost equivalent to disabling the SM. I do love your concept, and have included this in my personal ROM...
glad you like it that much!
I was hoping that chefs and users alike would get involved writing menu source files so if you think any would like this then point them to here. Tell them that, FoddTweak is the Tweakable Tweak app
I am still trying to get a grasp of the menu source! Havent checked into your latest files yet...but planning on soon...
Thanks a bit late finding this but looks a great tool
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
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.