Android pattern for activity "flows" - java

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.

Related

How to activate onclicklistener from Voice action - Android

I would like some help with this theme. I'm developing an app that requires voice actions. I'm using Cardvied, RecyclerView and ViewHolder. Right now, the app only have touch actions, it list some information, and you can enter in details if you click on the ítems. I would like to do is that this click become a voice action. Of course, the app will execute some voice actions like "Open ítem 1" or "close ítem". I would appreciate your help guys!! even if it's not possible or if I have to make some research, everything is welcome. Have a nice week.

Shortcut for creating simple dialogs in Android

Android Newbie here! I spent all yesterday trying to implement a simple dialog in my android app. I realised there is no easy way out. I mean all i just wanted to show to user is a simple choice between importing a video into the app from the gallery or recording a live video. My Parent UI is already consisting of two fragments in a split-pane style(Details on the left, gridview on the right). Now i want to show the options for importing a video as a dialog. Turns out i have to create another fragment(DialogFragment), give the fragment a UI(ListView), create UI for the list items, create adapters for my list, override getView method for my adapter with custom logic. is there no shortcut to this? While this might make me sound lazy (which i'm not btw cos i love coding), what if i want to create 4 additional dialogs, do i have to do this everytime? is there no easy way out?
btw I'm targeting SDK 11 to 19 devices.
Any help will be very much appreciated.
Have you had a look at the AlertDialog.Builder?
You could use this to build your dialog and then set your click handlers on setPositiveButton and setNegativeButton methods if you only want two options.
It was added at API level 1.

The Android "back" button

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.

Create a shortcut button with icon and name like samsung's clock app

I want to make a Button or ImageView or something like that to launch an app. At some point i want to make several to keep adding shortcuts like the Samsung desk clock app.
At the moment ive set up some blank Button's in which i want to be able to click, choose the app i want then the app create the icon and name to the button (like above) and it launch the intent when i click it afterwards.
Any ideas, examples etc are brilliant ive got brain ache searching for a way to do this :/
Check out this post: https://stackoverflow.com/a/7107138/1337412
You're basically trying to create a custom "launcher app" if you search StackOverflow and Google, you should be able to find plenty of examples of launcher apps.

Does Android have an Internet status turning circle in the top bar like the iPhone has?

The iPhone has this swirling icon, which you can make appear when the Internet is working behind in the background. It's a VERY simple call to turn it on/off.
Does Android have anything like this? How do I call it and how does it work?
You should display this in the ActionBar.
The simplest way
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setProgressBarIndeterminateVisibility(true);
Or using ActionBarSherlock for backwards compatibility
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setSupportProgressBarIndeterminateVisibility(true);
No, i haven't seen it on android yet. However with ICS and above, we see 2 arrows accompanying the WiFi or 3G to indicate if there is activity on the network. However it may not be possible to programmatically control it.
You could otherwise use a indeterminate progress bar within your activity to show background work.
You could try using Android Notifications and use an AnimationDrawable. Check this answer. (Note that I haven't tried it).

Categories

Resources