I want to make an Android application that controls an Raspberry Pi (singleboard computer).
To do that, I want to create a control page like the one below:
As you can see, there are section headers, listview items with a switch, listview-items with a checkbox and listview-items with only text and listview-items that go to a new activity(of fragment).
I want to create the same thing for my android application. But I want to know what the best way is to create a page like this. I have already tried a listview with a CustomListAdapter, but the problem is that ALL my listview-items have a switch or ALL my listview-items have a checkbox, and so on.
So is it better to create a page like this in an other way? (build it mostly in the layout file, item for item?).
The Android API includes an easy way to handle this. You need to create a PreferenceActivity. The Android API documentation provides a full, thorough explanation with examples. You can find that here
Related
Sorry if the title is it's not self explanatory.
I'm trying to make an application that can interact with other ones by adding them a graphic element in their UI.
Just like Google does with Google Translate new function.
You can see a graphic example here: EXAMPLE GIVEN
My questions are:
Is that even possible? (I guess it is)
Where can I start searching about this? I haven't seen anything in Androids Developer documentation. I really don't know how to search info about this.
Thank you all.
If you'd like to add a graphic element to your app, I suggest using the Toolbar widget (it's automatically added with the Basic Activity template). There's also the ActionBar, but I think the toolbar is preferred to use (newer).
You can get a better idea about it here.
https://blog.xamarin.com/android-tips-hello-toolbar-goodbye-action-bar/
http://www.101apps.co.za/index.php/articles/using-toolbars-in-your-apps.html/
As far as the behavior of the icons, you'll have to add your own logic to them. Intents (implicit/explicit) are one way to interact with other things.
I hope this helps push you in the right direction.
I want to create some thing like drawer menu that open from bottom of screen.
some thing like blow image. Also I want to know is that any special name?
You can use BottomSheet library. It works on Android 2.1+
https://github.com/soarcn/BottomSheet
It's called a SlidingDrawer. It was on the SDK but got deprecated a while back.
That said, this thrid-party library should do the job just as good. I've used it in multiple projects.
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!
iOS has the ability to allow the user to rearrange/reorder elements in a list.
This is done by going into Edit mode and dragging the elements to the required location.
A good example of this is the Edit mode in the Notifications screen in the Settings app.
Does there exist this kind of functionality in Android by default? Is it possible to enable this functionality within ListView or LinearLayout?
If this doesn't exist in the base Android functionality is there a library that does a similar thing?
I know of the drag and drop functionality, but this is most likely too low level as far as I can tell.
http://developer.android.com/guide/topics/ui/drag-drop.html
There are some third party libraries available in android
https://github.com/commonsguy/cwac-touchlist
https://github.com/bauerca/drag-sort-listview
There's an example from Google's DevBytes available now.
Video is here: http://www.youtube.com/watch?v=_BZIvjMgH-Q
Sourcecode is here: http://developer.android.com/shareables/devbytes/ListViewDraggingAnimation.zip
I wanted to make an app that you can select a country and it comes up with information about the country. I don't know that much about Java i'm hoping that this will help me learn more about java.
I would like this to be an android app
please help me
thanks
CS
edit: I am new to java so can you help me out and give me pointers on how to do this please.
Example: Lets say we have a listview that has the United States, Germany, and the UK
I already have the list view set up. How would i go about making a second view that would let me select the us and give basic information about it?
Unfortunately I am still a little unclear as to what you are asking but as far as I am aware the list view you create should be able handle clicks on it, so if you check out the ListView class in the android SDK there you will need to look for the onClick event you are after. Overload it and put in the code to create (I think you are asking for this) a second activity, to then show your selection. However that might be a bit complex so try and handle the click event first by perhaps a toast message. Then work your way up.
The second activity you could use to show information, or just create a dialog, or another full screen view to show the info.
I commend you for getting ListView to work without knowing Java. I would suggest you learn the language first before jumping into Android apps because the development resources assume that you have a good knowledge of the Java. There are lots of resources on the web for learning Java and you can do it all in the Eclipse environment if you wish.
Good luck!