[Q] Can you utilizing the phones buttons? - Web App Development

I am thinking of developing an app for android but I would like to know if you can make say one of the volume buttons do a specific action for your app (I am thinking the app will run in the background and double clicking the volume down button would activate it)

Kamil1232 said:
I am thinking of developing an app for android but I would like to know if you can make say one of the volume buttons do a specific action for your app (I am thinking the app will run in the background and double clicking the volume down button would activate it)
Click to expand...
Click to collapse
Yes, you can actually use native components with AppGyver's "Steroids.JS" ;
I can't post links, but, google appgyver, and download/install.
It's as simple as (using angular)
Code:
<button ng-click="function_name()">Click me</click>
Obviously, you need to know the basics of AngularJS, though, I believe they have a few different frameworks.

Related

Volume buttons up/down navigation?

I apologize if this is a repeat or an obvious question, but...
Has anyone had any success remapping the volume buttons to be page up/page down or simply up/down for any purpose? I'm specifically thinking of eBook readers that require tapping or swiping the screen currently to flip pages. But also perhaps browsers as well.
We saw this on WinMo devices back in the day, but I've never seen it on Android. Is it impossible, difficult, or simply not in demand?
Would appreciate any insight, and thanks for all you do.
I'm thinking an app would be able to hook the volume keys, and override their functionality.
But it would not be so easy to hook that functionality from outside the app you want to affect. You could also remap the volume keys to page up/down, assuming you have root.
Don't know about global remapping, but apps often do it themselves. For example Dolphin Browser HD has settings to scroll the page with vol up/down.
maejrep said:
I'm thinking an app would be able to hook the volume keys, and override their functionality.
But it would not be so easy to hook that functionality from outside the app you want to affect. You could also remap the volume keys to page up/down, assuming you have root.
Click to expand...
Click to collapse
Thank you!
Is there a built-in page up/page down function to which they could be mapped?
It would be more useful to make it either application-specific or a global app to grab them based on which app was running, but remapping might be worth it.
I'd love to see an app that would use the volume buttons as a physical camera shutter button. So much better than an onscreen button.
Aldiko reader in the market uses volume buttons to flip pages
-------------------------------------
Sent via the XDA Tapatalk App
katmandu421 said:
Aldiko reader in the market uses volume buttons to flip pages
Click to expand...
Click to collapse
Thank you so much for the help! That's halfway to solving all my problems!
Page up/page down on a browser would be great as well, but I'm very glad to have this.
Thanks again!

[REQ] Overriding Home button long press

Hi!
Was wondering if we could somehow override the home button long press to run a custom application instead of showing the recent apps list? This way, we could develop a custom application which shows more stuff rather than just 6 recent apps.
Some ideas are - integrating a task manager which shows running apps, favorite apps shortcuts, shortcut to app drawer etc.
I could develop the application but I wouldn't know how to override the home button long press! Any ideas anyone?
Cheers,
San
Well, there is at least one (paid) app that already does this (could be more but i don't know of them) - "MultiTasking Pro" http://www.cyrket.com/p/android/com.tkdtnek23.app.multitaskingpro
It would be nice to have extra functionality though, such as a clock (say, if you're in the middle of a game and want to check the time).
As for how it works, just from testing it out, it appears to act as a launcher (given that single home button press takes you to home launcher). I gather this as I had to set it as the default app when i pressed home button for the first time, aswell asthe fact that you have to select the home launcher in the app settings.
The way the app works is, press home button once brings up the menu (overlaying existing app). press it a second time and it takes you to the "default" home launcher as selected in settings. If you hold down home, the original app menu pops up, reinforcing the fact that this isn't a replacement per se.
Of course, overriding the original home button hold function menu would appear to be a much cleaner solution, and I welcome any info on that... whether its integrated into touchwiz or what not... One things for sure, is that samsung modified it to include a link to their "task manager" app.
TaskSwitcher is better, faster, uses less memory and it's completely free.
However no app can replace the long press. It needs kernel/system file modding.
Bec07 said:
TaskSwitcher is better, faster, uses less memory and it's completely free.
However no app can replace the long press. It needs kernel/system file modding.
Click to expand...
Click to collapse
Indeed, not possible. Does anyone know if it was implemented in other android phones?
PS. Power strip is better =) Very very fast and you can see 12 recent apps + widgets. Itching thumb is very promising, but its a plain beta for now.
Yeah but itching thumb uses a LOT of memory.
Bec07 said:
Yeah but itching thumb uses a LOT of memory.
Click to expand...
Click to collapse
For me Itching Thumb is currently the only task switcher style thing I find good enough (interface, functionality) to run next to Launcher Pro... I uninstalled all others I tried before.
But if I could have Launcher Pro on short press home, and Itching Thumb on long press home, that would be exactly how I would want that . Because I think optimizations such as memory use will come in time anyway.
I hope for the visual style to be integrated in android and have a real preview, live of the app.
Bec07 said:
However no app can replace the long press. It needs kernel/system file modding.
Click to expand...
Click to collapse
Any idea on what would need to be modified?

[Q] Is there an e-reader with shoulder button support?

Yes, i know thats not what the play is for, but sometimes i want to use it for e-books.
Is there an app that allows me to turn pages with my shoulder buttons?
PLAY around with the button changer apps
I used the XDA App to post this, what did you use?
Played around with them but could not get ihem to work. I use CM7.
Do they even allow remapping to the volume keys?
Well there was an app, but doesn't support new FW.
no point in making now since ICE CREAM SAMMICH is coming next month. Give time till NOVEMBER and in sure there will be an app for it.
I used the XDA App to post this, what did you use?
And how would waiting for till November solve anything?
Back to my question, is there an e reader out there that allows you to chose wat buttons turn the page? Seems to me like that would be a basic feature, but the ones i tried didn't have it.
Keep in mind that unlike volume buttons, shoulder buttons are by no mean a standard feature of Android phones. It's not a "basic feature" at all.
The user hatcyl is working on an app to give extra functions to the buttons. That would be your best bet
I am not saying shoulder buttons are a basic feature, but i am saying that choosing what button goes to the next page is a basic feature.
There are tons of different phones out there with facebook button and multimedia buttons. Not to mention camera buttons. Or even the dpads.
Is there no ebook reader app that lets me pick what keys turn the page?
Azeazezar said:
I am not saying shoulder buttons are a basic feature, but i am saying that choosing what button goes to the next page is a basic feature.
There are tons of different phones out there with facebook button and multimedia buttons. Not to mention camera buttons. Or even the dpads.
Is there no ebook reader app that lets me pick what keys turn the page?
Click to expand...
Click to collapse
I've tried Cool Reader, FBReader and Aldiko to no avail . The only common feature for Android smartphones are the volume buttons. There are more readers though, like Moon+, Laputa and Mantano.
http://forum.xda-developers.com/showthread.php?t=850464
This has been my solution.
I used it to set both shoulder buttons to volume down.
Hope it helps everyone else.
Azeazezar said:
http://forum.xda-developers.com/showthread.php?t=850464
This has been my solution.
I used it to set both shoulder buttons to volume down.
Hope it helps everyone else.
Click to expand...
Click to collapse
Do you need to reboot every time you change the mapping or does it work without reboot please. Also if I map sholder buttons to dpUp and dpDown for example and then start a game which has it's own function attached to shoulder buttons, what will be prevailing: my own mapping or the in-game mapping? Thank you in advance.
You have to do a "Hot reboot" to change the buttons. This takes about a minute.
I haven't tried gaming with this settings. I always change the buttons back when i'm done.

Where's 'Menu'?

Looking at the softkeys, where is the Menu key? I see Home, Back, and the new Multitasking key, but no Menu. How can this be? The iOS method of integrating all menu options into the application UI is terrible, and what about apps made before ICS? Lack of a Menu key would make them unusable. I must be missing something here, but I can't see what it might be.
A virtual menu button appears in the form of 3 dots. It can be seen in this photo.
Tung_meister said:
A virtual menu button appears in the form of 3 dots. It can be seen in this photo.
Click to expand...
Click to collapse
Nice catch. Was wondering about that.
Menu items are represented by the 3 vertical dots at the top right corner of apps.
The indication is that new apps should no longer hide their menus, but rather make them intuitive to access in the app's UI.
For legacy apps, we'll probably see a menu button of some type appear along with the 3 softkeys at the bottom.
On my Honeycomb tablet either a button is in the top right corner or another is added to the bottom when menu is needed... I'm guessing HC is a good example of what we'll be getting, and if so I look forward to it
Thanks so much for a useful thread. I was actually wondering about that myself. Glad to know its non-obtrusive and clean
Sent from my GT-I9100 using xda premium
You have lost the search button though. Not all apps will handle this well... I had to tweak an app I was writing because of this (luckily found fairly early during testing on Honeycomb).
Of course for most apps search isn't useful - probably why they removed the dedicated key.
TonyHoyle said:
You have lost the search button though. Not all apps will handle this well... I had to tweak an app I was writing because of this (luckily found fairly early during testing on Honeycomb).
Of course for most apps search isn't useful - probably why they removed the dedicated key.
Click to expand...
Click to collapse
The idea is if the app needs search in order to function properly, you just put the search button up in the menu bar, just like they're doing with settings buttons.
Otherwise, the google search button is at the top of every homescreen now.
martonikaj said:
The idea is if the app needs search in order to function properly, you just put the search button up in the menu bar, just like they're doing with settings buttons.
Otherwise, the google search button is at the top of every homescreen now.
Click to expand...
Click to collapse
The menu button happens automatically (technically, since 2.3 android has called onCreateOptionsMenu at activity startup so it knows you need it already).
There simply is no search button in Honeycomb/ICS - you have to stick it on the options menu, the action bar*.. somewhere the user can reach it. That needs code (not much.. respond to 'search' in the options menu by calling onSearchRequested()).. existing apps will simply lose that function if they run on ICS assuming a button exists.
We're not talking about a lot of apps here.. Not much point in a search function in 'Angry Birds' for example. Just something to bear in mind when developing a new app or trying to work out if your favourite app will work without issue on ICS.
Home screen search is totally different.. that searches the global search (emails, contacts, etc.). Different class of app entirely.
* The honeycomb search widgets are really flexible, but of course not available unless you break compatibility with <3.0.
TonyHoyle said:
You have lost the search button though. Not all apps will handle this well... I had to tweak an app I was writing because of this (luckily found fairly early during testing on Honeycomb).
Of course for most apps search isn't useful - probably why they removed the dedicated key.
Click to expand...
Click to collapse
There are already quite a few phones out there without a search button. My almost 2 years old X10 doesn't have a dedicated search button and i never missed it. The search function is bound to long-press menu at the x10. Given the fact that ICS has a dedicated task switcher button, they could bind the search to long-press home for example. Just an idea though
Sent from my X10i using XDA App
qwer23 said:
There are already quite a few phones out there without a search button. My almost 2 years old X10 doesn't have a dedicated search button and i never missed it. The search function is bound to long-press menu at the x10. Given the fact that ICS has a dedicated task switcher button, they could bind the search to long-press home for example.
Click to expand...
Click to collapse
Hmm.. news to me - I've never seen an android phone without one. Lucky I was doing tablet compatibility testing then
There will probably also be custom roms that put it back (since a custom rom can do anything it likes with the buttons.. change their apparence, colour, hide them completely, make them dance up and down..).
TonyHoyle said:
Hmm.. news to me - I've never seen an android phone without one. Lucky I was doing tablet compatibility testing then
There will probably also be custom roms that put it back (since a custom rom can do anything it likes with the buttons.. change their apparence, colour, hide them completely, make them dance up and down..).
Click to expand...
Click to collapse
The Galaxy series in general (SGS1, SGS2) do not have a dedicated search button. They have just the menu, home and back buttons. However search is bound as a long press to the menu button which I guess won't be possible anymore. Haven't really found search to be that vital (maybe because I don't want to long press the menu button just to bring it up when I can search in other ways)
Since it's purely software, I know for a fact someone will mod in a search key.
Sent from my Samsung Galaxy S3 using XDA Ultimate App
That would be pointless. When search is available, the search box will appear in the menu bar of the app.
Sent from my Nexus S using XDA App

[Q] Remap home soft key long-press?

Couldn't find anything about this anywhere, so I'm starting a new thread.
Is there a way to remap what application loads when long-pressing the home soft-key? I've remapped what app loads when holding the volume-up key with the screen-off, but I'm looking to have a specific application run when holding the home button soft key, instead of the default "google" option that appears when doing it on the stock ROM.
Any help would be greatly appreciated, as would the monitors moving this thread to its proper location if it should belong somewhere else :good:
We'll need root.
I wish OEMs would include this level of customization by default. I wouldn't mind having my home button long press either launch my camera or the App Swap app and have my recent button long press switch to the last app.
Sent from my LG-H811 using Tapatalk
partylikeaninjastar said:
We'll need root.
Click to expand...
Click to collapse
Thank you. I was hoping there might be a workaround (like KeyPlus) or an app like Home2Shortcut which I used on my SGS5 to accomplish that change. Oh well. Guess I'll just keep doing what I've been doing: patiently waiting for root to drop whenever the dev's involved feel it's ready! Thanks for the quick reply!

Categories

Resources