I want to make a section in my app to allow the user to specify a range of time. I'm trying to make the design to something like android timers at the moment, but I'm having trouble. Would I need to make a custom preference for the design, or would I need to use SharedPreferences in a Fragment?
Image of Android Clock Design
Additional Question:I'm using a Crystal double range seekbar that is visible when I run the app, but it doesn't show when in Android XML design.
I am not getting your usecase here. As far my understand, you need a screen to ask the user to the enter the date range like date from & to. If so, my suggestion would have the different screen to get those values and storre those in a SQLite.
Related
I am thinking about creating a text-based game (similar to gamebooks) for android device. In this moment only theoretically. Do you have some advice please, which way to go?
You probably know how gamebooks works, but the gamebook I want, will be very easy, should work like this:
User has shown some image, text and 3 options (questions), he decides which option to click, then a new page is showing (according to the clicked option) with another image, text and another 3 options. Then again, the user clicks one option, another page opens, etc.
My question is not how to do it programmatically, but how to start with this in Android Studio, what system to use for such game on android or which way to go.
Because I think it has no sense to create intents after each click, as there might be hundreds of clickable options.
I have already created such game on my website with php/html/js, but I want to create it also offline for android.
Intents implies one activity per page - unmaintainable.
You should work with a database and load based on user interaction. So you'll need to learn about Databases and Asynchronicity (working in the background while updating the UI so the user knows)
On the Android design guideline there's this line:
which is the same as how the WiFi setting work in the Settings app.
I can implement this with a regular preference and a custom second screen, but i suppose there is a easier way?
I am relatively new to android and want to create an application that permanently overrides androids basic softkey behaviour and view (for devices with soft keys).
Some functionalities I want to implement are changing the size of the softkeys window at the bottom, change its images, and possibly change its functionality.
For example, the user can set the size to of the softkey to be "large", "medium" or "small". And I can change the functionality of the back button to open say a particular application instead of going "back".
I'm basically looking for a high level answer as to how to do this, a basic direction of what I should read/study in order to be able to accomplish this. I realise this may require root access.
Please note that I want this behaviour to change not only in my application but I want the effect to exist on all applications. If this requires the application to be running atleast at the backend, that is fine.
After doing some decent amount of search, it seems I will have to make changes in the systemUI.apk, or possibly get its source code and modify it. Is this correct?
Thanks in advance.
I don't think even root is going to be enough for the type of changes you are describing. You're going to need to edit the Android source code and build your own system image.
Well you can't override system resources because they are part of the system image.
What you are looking for is called Home Application which can be developed like any other android app no need for root , you can find an example for it in your sdk samples.
Home Sample Application.
your app would be responsible to have UI components to send the user to all of the phone functionalities which includes:
Place for wegits
Place for apps listing (menue)
Access telephony functionality (call, phone history ...)
Access settings.
Is the control shown in the image below built-in in the Android Framework or it is a custom control. If it is custom control, should it be built using a button with background that pops a calendar dialog on click?
Thanks
These are just normal TextViews with a custom background selector and an OnClickListener that triggers the dialog.
If you want to know how a certain view or layout is built, you can use a tool called hierachyviewer (which I used here too). It shows the view hierachy of running apps on your device and is included in the Android SDK in your ANDROID_SDK/tools directory. The program is a bit unintuitive at first, but certainly a useful thing to know. See the documentation for more information about this.
Firstly I'd like to say that I have only been working on Android for about a week now, so I guess you can consider me a newb! Therefore I apologise in advance if the solution is overly simple, but I can assure you that I have done my research before posting here, and haven't found an appropriate solution as of yet (or maybe I have and don't fully realise it!). Nonetheless, having lots of fun and just want to solve this problem and learn, so here goes...
The Application
The application I am developing is essentially a reminder service, and I am currently working on the preferences screen.
The Problem
I would like the user to be able to specifiy a time when he/she will be reminded daily. I want this selection to be done via the preferences screen. This is how my preferences screen looks so far...
My preferences screen
My Question
Ideally, whenever the user selects the "Alarm Time" preference, I would like the following to appear (this is a screenshot of a preference from another application - PillReminder).
Preference with Time Picker widget (taken from another app - "PillReminder")
My question is, what is the best way to create this? I really want to keep all the visual aspects of the application using only XML, therefore I don't want a Java solution. Is this possible or am I completely off track? Other potential solutions I have heard of are using themes, alert dialogs and extending preference classes etc. Maybe some of these are correct, but I am unsure.
Any help would be greatly appreciated, thanks! :)
My question is, what is the best way to create this?
That is probably a custom DialogPreference that happens to have a TimePicker in it.
I really want to keep all the visual aspects of the application using only XML, therefore I don't want a Java solution.
Custom preferences like this cannot be defined in XML. You will need to create a subclass of DialogPreference, define what goes in the dialog, and how the dialog's contents can be stored to (and retrieved from) a SharedPreference value.
My ColorMixer CWAC project has a ColorPreference that you may wish to examine.