ok so im making a lovely little app for my phone that will let me convert bases. This would make my APCS homework much better and provide me some practical and useful coding experience.
I see lots of questions concerning the time and date pickers but that is not what i am looking for. For example, on iOS, if you press on something that is almost like a dropdown menu you can scroll through the selections and choose which one you want. Any ideas?
How about a spinner?
Related
On a screen I am designing there is a large number of commands the user can execute. But they are groupable so I thought about using drop down menus.
I'm wondering if it's usual to use drop down menus for commands. I actually never saw them being used for anything but switching views and picking information.
And if yes, which pattern or building block can I use to implement it? Or do I have to write it by my own?
I suppose this depends on what you mean by "commands". In general I would say no. A Button may be better depending on exactly what you mean. However, it sounds like you are talking about a lot of commands in which case a lot of Buttons may not make sense.
A ContextMenu may be better for this especially if you are talking about editing an item and such. These are easy to set up and there is a good example in the docs that I posted a link to. A user simply long-clicks an item and a small menu with options is brought up.
An ActinBar may suit you also. But it really depends on your what, how you want it to look, and what your users would expect. But the first thing I think of when I read "commands" would be a ContextMenu
Two other options you have could be PopupMenu and PopupWindow. Note that PopupMenu requires API >= 11. But with your comment I definitely think a Spinner would be appropriate.
Check out lorensiuswlt/NewQuickAction3D: It really pretty and easy to use.
Tutorial in the README:
https://github.com/lorensiuswlt/NewQuickAction3D
If you more interested in something as seen on older HTC devices:
https://github.com/lorensiuswlt/NewQuickAction
I'm very new to coding and have searched everywhere but havent been able to figure this one out.
Im trying to create a Lap Time Leader Board for various tracks in a video game guide. The user needs to be able to Click on the track name and then inside of the new layout "Create" a new time...that needs to allow him to imput the Car and the time it did on this track, then it needs to either sort itself or be manually sortable so that the times are in order from fastest to slowest. While i can build the layout easily i get stumped there.
How can i make it so that when the user clicks "Create New Time" the code gives him the spaces for time and car model.
How can i make sure it saves the correct info with SharedPreferences since each time will need to be saved differently (i think this has to do with the name and then ++ but i could be wrong)
How can i make it sort itself or be sortable for the user.
Can someone show me some sample code that does this? I dont know much of anything about SQL and would prefer not to use it if i can avoid it.
Im sorry this is such a noob set of questions but this after trying the notepad tutorial on AD and numerous video and book tutorials i havent found what i need to make this a reality.
You can always use a the Dialog class to create a pop up dialog to allow the user to input the information you are looking for. Sorry that you wish to not use SQL
Shared Preferences isn't such a good idea because you will have to do a lot more work to code your desired affect. A datatbase with simple Relations(tables) will suit your needs as opposed to Shared Preferences where you'd have to get creative to have the same data structure. Such as an ArrayList of BasicNameValuePairs, that could be a head ache. Database is the way to go, you can do everything you need if it's properly set up.
Sorting is quite easy in Java as you could always use the Collections class and implement the Comparable interface to compare your lap times to each other and sort them by total time. For a display such as that you would want to look into a TableLayout in Android XML. Don't worry so much about that, the Eclipse IDE will let you easily create and populate it. This would involve loading your laptimes from your database into a List and sorting them by time. It's a bit tricky but easy once you understand the Comparable interface and Collections if you need it.
If you need more insight post a comment, just wanted to share some ideas on how I would approach it.
Background: I've want my users to select their birth year from a list of birth years.
I'm currently using a spinner with an item resource in XML that creates a long-scrolling drop-down list. I've read posts on using DatePicker but it would require some major modifications that make is somewhat unstable from platform to platform. So my question is:
How best to represent a selectable list of years in a form?
I do not think there is much of best practice available here. What you choose will depend on the feel of your application and how well the method integrates with it.
That said, a simple EditText is likely best - nothing clever required. Consider also setting android:digits="1234567890" on it. Doing so will also display the comfortable numeric keyboard.
I can't say I'm familiar with the andriod user interface but why does it have to be mutually exclusive to either selecting or typing in a year? Cannot you have a textbox with a drop down button next to it to select a year?
For me personally, I'd consider a date picker to be a little extreme unless you are wanting their full DOB in which case you need to be really careful how you do it due to the large variations on date representations throughout the world; in that situation then a date picker would possibly be the most suitable option.
Edit: Just something to note, if you do choose a drop down list, make sure by default you select a suitable year rather than the most recent. You know your users best but it is unlikely that you'll get a 10 year old using your app, and showing 10 items (which would automatically be skipped for 99.99% of the users) on a drop down listbox can be quite a bit of screen real estate on a small device.
I'm looking to make a new type app that when the user open it for the first time it will open up a pop-up menu that contains multiple check boxes that the user can select from and will then save their selections for later use. After the user selects their choices I would like to have a monthly based calender on this same screen that the user can select a date from and based on their selection this will then take them to a separate screen showing the news for that day.
I am fairly new to android app development and this will be my first go at it. I have read several books and websites but cannot seem to find the help I need to produce the code for the above desired functions. Any and all help with this will be much appreciated.
Read these tutorials and you'll be able to create just what you need
Tutorials
Your question is very vague in fact, so I will only suggest a few points to start reading from, that I believe are important.
I think that you will answer any other questions you may have by reading through the developer documents for Android and studying the supplied examples. But don't hesitate to ask another, more specific question if you run into trouble.
tl;dr
Activities (must read!)
Dialogs (you will need these)
Data Storage (also important for the app you describe)
If you're still lost, just get some sample code from the repository and toy with it.
Good luck!
I need to create a Bi-directional spinner in Android .
Providing the following sample:
Can anyone provide any inputs ?
Thanks in Advance.
Does this help?
Android Number Picker Dialog
I'd agree with #Matt that a number picker is probably the best way. I wouldn't try and exactly duplicate the look of a windows form, as on a touch screen those up/down arrows are going to be very small.
If you really want the up/down functionality and are planning on using much larger buttons then you just need a couple of onClickListeners, one to increment the value and one to decrement.