The Android "back" button - java

I am an Apple iPhone user. I have never owned an Android of any type so I am used to the button I have to tap on the screen to go back a screen instead of the physical "back button" that Android has. An iPhone developer has to code the back button in for the user to operate the game but an Android developer does not necessarily have to code a back button and can just rely on the physical button on the phone.
My question is if it is okay for me not to code a button for my Android app and just let the user use the hardware back button on their phone? If there is no back button to tap, will an Android user instinctively know to hit the physical back button to jump back a screen? I don't really know this answer since I have never owned an Android and always rely on the iPhone coded in buttons.
The picture below is me coding in the back button instead of relying on the physical button on the phone. I am wanting to back out the back button from my code.

You shouldn't code a back button on your app. See the pure android guidelines here for more info on android apps look and feel.

Every Android Device contains Back Button. And Android users using the Back button since first version of android released. They All have idea on Back button , No need to implement it separately, User already Habituated it.

I have developed for both iOS and Android, and find the best answer to be using both. Android users know to use the hardware back button, but new users, or former iPhone users, often expect an on-screen button. There is no harm in having both, and an on-screen button may be a nice visual touch.
Cases where you may decide not to have a back button include layout for smaller screens - when screen real-estate is very precious. Just keep in mind that the most important part of an application is the user experience.
The key is to make your app as user friendly to all users - but don't take away the expected experience from dedicated Android users (for instance, if you are developing a single-activity app with multiple popup Views, the ideal performance of the back button will close the view, rather than closing the whole app).

Also if you want to have a button to go back at the top right of the activity, there is a way to add one on the action bar. Take a look at the Android Developers page if you want.

Related

How can I, if you press a widget for a long time, create a "Settings" button between delete and info?

How can I, if you press a widget for a long time, create a "Settings" button between delete and info? You can find this on Samsung calendars, for example.
How can I, if you press a widget for a long time, create a "Settings" button between delete and info?
That is not possible in general. The behavior of a long-click on an app widget is up to the developers who implemented the home screen, not you or I. Certain home screen implementations may have an API or convention that enables this, but it will not work across all home screen implementations.
You can find this on Samsung calendars, for example.
Not necessarily. Make sure that you are testing with a launcher/home screen implementation that is not Samsung's.
The developer of a home screen is welcome to create "widgets" that:
Are not really app widgets, but rather are features of the home screen that present like app widgets; or
Have a private protocol with other apps that enable certain options that are not available to all apps

How to launch my app programmatically, if an another app opens?

I want my app automatically open when user click (for example) chrome or any other apps.
How to do this?
My app is for preventing people use cell phone all the time.
Explicitly, there is a mission in my app. when user starts this mission, user cannot use other app until they give up the mission.
User can minimize my app, but when user click another app, my app will prompt programmatically to tell user not to use the cell phone.
Instead of preventing user to launch other apps, I think you should use activities' life cycle. You can add code in onPause() and detect user press home button or back button. And when your activity is not on foreground, you can pop a dialog or something to remind your user focus on his work not his phone. BTW I do see the positive side of your app.

slider on android home screen

I am creating a application which needs to show all the time to user, User also can hide that app, When he drag his finger from left to right or right to left(On android screen, No matter in which application he was) then all of my document list will be shown.
I know its all most impossible, But some apps are all ready doing this, I dont know how this is possible.
I searched on google but didn't find any useful link.
Here look at this snapshot what i want.
App which is using this:-
Multitasking

How to open my Android app on a long press of home, back or recent apps button?

I want my users to be able to launch my app by long pressing back button, recent apps button or home button. Or even long press on volume up/down or power button.... something which would allow users to execute my app without touching a screen icon.
I offer similar voice solution to Google Now, which btw. opens after a long press on home button. Any way I can do the same? I get this question from my users almost daily...
I don't think your users will be able to do this without rooting. I found this thread which is worth reading:
http://forums.androidcentral.com/samsung-galaxy-s3/183113-button-remapping.html
alternatively they mentioned Go Launcher app
I've read through the list of ACTIONs that you can use for starting an activity through intents, but can not find any of the ones you wanted. If you do find any other ACTION useful there is more info on how to actually do it here.

Android pattern for activity "flows"

I'm developing an android app that has a bunch of screens (activities) that are supposed to have "continue" and "back" buttons at the top. Can you tell me the right pattern for implementing this? I've seen some iPhone apps that have this but Android apps usually don't (I think partly because the back button is part of the phone).
I found a post online about an Activity class that has "sub activities" which kind of seems like what I want to do, but I'm wondering if there's a simpler solution or pattern for creating flows like this (in which several activities are linked with continue/back buttons).
You answered part of it yourself. There shouldn't generally be a software back button because android has a hardware back button. As for a continue button, that's extremely context dependant so it would probably be written in software based on the context.
No that doesn't sound like what you want. You're probably thinking of an activity group and from the very vague description of your design, you don't want those. There's no "simpler" solution or pattern to create flows like this because this is the exact default android behaviour.
Just start a new activity in your "continue" button, and the back button will finish that activity.
I'm developing an android app that has a bunch of screens (activities) that are supposed to have "continue" and "back" buttons at the top.
If you want to implement a wizard, use buttons at the bottom and do it as a single activity, perhaps using a ViewFlipper for the changing contents.
If this is not logically a wizard, just allow the BACK button to handle "back", and tapping on something meaningful to go forward, as a set of regular activities, like a regular Android application would.
In other words, please follow platform navigation conventions.
can you just open a new activity as per usual android development and make the back button call finish() you can set your theme to make the activity animate out like the iphone when finish is called.

Categories

Resources