I am developing an application using the Action Bar Compact.
Right now I'm trying to set the Activity Application Preferences.
As Java does not have multiple inheritance can not inherit both ActionBarCompact and Preference Activity.
I need a way to use the two classes at a time, so you can use the Action-bar to navigate and to use Preference Activity activity as Preferences.
PS: My apologies if the question is not clear, my English is not quite good.
Related
I am trying to figure out how can I modify the icons and interchange the order that appear in android auto navigation activity.
So far I have found this code needs to be modified directly in AOSP. The file that I think that is drawing this is CarNavigationBarController.java
I have not been able to figure out the resource that I need to modify the icons and their order.
Thank you in advance.
You can't.
This bar is generated by Google's Android Auto application and it's proprietary.
The Android Auto playback menu is standard, and the third party apps are not allowed to change the interface
You can only customize the color of the button, to distinguish your brand for some degree. Otherwise, the experience should be consistent and predictable to minimize the drivers distraction.
I'm a bit confused as to wether I should create a plain activity or a fragmentactivity. My app is displaying an expandableListView and a dialog. Thats it (pretty much).
I cannot find any instance that my app would be better if I used a fragmentActivtiy because first of all my app is not designed for tablets, and second I'm not adding or doing anything to my main activity during runtime to change the views.
My problem is that it seems it is a must to use fragments, because when I checked out Android dev site on dialogs, it only explains how to implement them using fragments. Are plain activities highly un-recommended or I just have to judge my app, and are all features such as dialogs available for plain activities? (And can someone please give me a link to a good source where I can learn about dialogs in a normal activity?)
http://developer.android.com/guide/topics/ui/dialogs.html
It says here that you should use a fragment but does that mean i have to go all out and make my main activity a fragment?
Here is some discussion about using Fragment or Activity for dialog: Show fragment as a dialog or as a usual activity
If you want to make your dialog as Activity, hope this tutorial helps:
How to create Dialog activity in Android?
A FragmentActivity is an Activity because it extends Activity See here. The question the mean to ask is really a question for your self, do you want your app to support API >= 11 (3.0 Honeycomb) or API >= 4?
In API 11 Android introduced the concept of Fragments to deal with creating apps particularly tablets. But to add support for all the devices still running < 11 they created the Support v4 library which is where FragmentActivity lives.
If you are not using Fragments at all then just use Activity because it's available at all API levels. (it just got added functionality in >=11). If you want to support >=4 and may use Fragments then use FragmentActivity and your covered. I noticed things in the v4 library have started to be deprecated (starting to be phased out by Google). Personally, I won't make a new app with API <14 and suggest you stay above 11.
As far as Dialogs go. You don't need to used a DialogFragment but same question above applies to API level. I typically just used Dialog to show mine even if I'm using Fragments.
Hopefully this clears some things up for you. Happy Codin'
Lets say you've made a messaging app. The main activity would present different contacts and give you options for sharing, messaging, voice-calling, etc. Would each of those options have separate classes all stemming from the main activity class file? If so, would linking those classes into main activity be as easy as creating a method stub in the main activity to open those activities/classes for each option pressed?
I don't think that it's a good idea to use only one Activity for your Application.
Because in android an activity is a single, focused thing that the user can do. Almost all activities interact with the user.
I suppose that for options you want to have a different UI and different user interaction.
So i think that you should use multiple activity's for you options.
To find more information about Activity's check the link:
http://developer.android.com/reference/android/app/Activity.html
I have looked quite a few places but can't seem to find this specific solution. I am interested in creating a menu that will always be visible across every layout/view of the application. This menu would act much like the header/menu of a website that is fixed and always exists across all pages of the site. I assume I can simply create a menu and have it's visibility shown from initialization but I'm not sure if that's the best way. I don't want the user to have to click any other buttons to open the menu, I just want it fixed and constantly visible from the start of the app.
Thank you.
Any help is appreciated.
Fragments, they are a way to define parts of the user interface. They are similar to activities, they have their own lifecycle. They are also closely tied to the life cycle of their parent activity.
You can add them statically by declaring them in your xml manifest and in your layout file
-or-
you can add them dynamically in runtime by creating them as java objects and xml layout files and then add them using the FragmentManager class.
check out the Documentation on the android developer website
https://developer.android.com/guide/components/fragments.html
also, check out some tutorials on youtube, I like these ones especially:
https://www.youtube.com/watch?v=6GyGtCMoR_U&list=PLonJJ3BVjZW4lMlpHgL7UNQSGMERcDzHo
Good Luck!
i am iOS app developer. Now when i created an app on iOS i want to do the same on android. With java i was familiar just now need some time to remember.
i was looking at some tutorial how to do one or other things. But what i can't find is the basics how everything works. How classes is interacting with each other.
For example i want to create registration window with few buttons and alerts.
I want registration window to be called just once when app is installed and just that.
Should i create new java class and few layouts, one for View with buttons and other for Alerts ?
Or should i create other class for alerts if i need them in other flow of my app ?
And how i should call that window with registration from my main class, which is
extends Activity
Also if there are some developers who came this road from objective-c (iOS) to java (android). It would be nice for some share experience how they did that.
Thank you for any help :)
Very few of the concepts in iOS and Android are similar. On Android you have Activites, Intendts the Manifest. When you design your layout it should be resolution independent. You have a search, back and a menu button and variable hardware. All of this has no equivalent in iOS.
That said, I think you just have to read the basic concepts and the getting started guide no matter if you come from iOS or never have done mobile development before.
EDIT
To answer your concrete question. Take a look at the lifecycle of an Activity and Preferences. With this, you could do some action on the first start of your main Activity and store some flag in the preferences when it's done. On the next start you just test that preference and skip the logic.
You can create one activity (.java file) and one layout(.xml file with buttons and input boxes) , alerts could be toast notifications:
http://developer.android.com/guide/topics/ui/notifiers/toasts.html
All you require for this is a activity and a layout xml for that activity, this activity will be your main ie the entry point to your application, in that activity oncreate method you can check if it is registered or not by setting a flag or something which will direct to the next activity if its registered.
GOOD LUCK...
Just like your nibs in iPhone you create xml layouts in Android. And for view controllers here you make activity. One important thing is AndroidManifest.xml file, it contains all information of your app (like plist) plus all the activity information(Intent type and launcher methods).