How do I set the time on an android digitalClock? - android

I'm creating an android application that gets the current time in a different country/time-zone. I'm making it as there aren't many other apps on the marketplace that do the same job.
I've got an digitalClock underneath on my app, how do I change the time on the clock - take on or off a number of hours? For example, I may want the clock to display the time in another country.
Please excuse the simple questions!

Related

Android off-game click tracking

I would like to know if it is possible to have a process that would constantly run on the phone and would track the number of times a user taps on the screen.
For example, the user downloads a game, plays and then quits the app and although he quit the app, this process that got installed together with the app will still run and all that it would do, is that it will increment a value every time the user taps on the screen and then remember the said value, in order to be used the next time the user starts the app.
I don't know if this is a simple question or not but please keep in mind that I am new to Android development and I did not find any related topics on this.
Thank you in advance.
Yes, it is possible. Using certain flags on your service, you can create a system-wide overlay that should allow you to catch all click events systemwide. However, keep in mind that it seems that Google have tightened up security in Android 4.x, so you may have trouble getting this to work on more up-to-date versions of Android.
For specifics about implementing this, see this question: Creating a system overlay window (always on top)

How Change Date and Time inside my App (not via settings), best way to do it?

I'm building an app that will be bundled with an equipment. I want to block all access to Android settings, there is not physical button to go back, only touchscreen. So this won't help: startActivity(new Intent(android.provider.Settings.ACTION_DATE_SETTINGS));
I want to change time and date of the device through the Application. I researched a lot and every solution I've found to change time and date programatically in Android seems to be over complicated (putting the app inside system/app or something).
As I've come to know, having superuser access and declaring SET_TIME on AndroidManifest only doesn't help.
The application must display hh:mm dd/mm/yyyy
In my App settings, the user may set the date as being 13/01/2014 (dd-mm-yyyy), but let's say today is 10/01/2013. In my app I would do something like this today+offset (3 days). The same goes for the clock.
I was thinking in creating a thread that keeps track of the current time to update the text field with the current time (+offset defined by the user) every minute and another to update the date (the machine may work for a very long time), where I format it using the offset the user configured in the App. I don't like this solution, however I'm not sure if Android has another more efficient way to do this kind of task.
So the question: Is there a better way to do it other than using threads?
I was thinking in using a thread with postAtTime(), I guess it's more efficient than being inside a loop and checking if the time/date has changed from time to time.
I found out the answer I needed here: Setting system time of ROOTED phone
My Android device is rooted and using CrazyCoder solution worked. Although it will not work on Android emulator, but with rooted device.

How to set a background on an alarm clock app

In an Android alarm clock app that I want to develop, I want to allow people to have a custom image as the app's background when it goes off, rather than having the device's stock background, but I don't know how to go about it. It might actually be really simple but I am still a beginner (a shocker I know) so yeah does anyone have any ideas??
Just in case people are getting confused, I DON'T want the app to change the person home screen wallpaper, just the alarms background
I haven't started the app yet because as I said I need to know this one thing before i spend a few weeks developing
Kind Regards
Ryan
I believe this question has been asked multiple times before. Did you try searching the site prior to asking? It is a pretty basic question if you are just trying to change the background wallpaper on Android.
Edit based on your comment: See here.

Starting a Workout log app

I'm starting a project, which is a work out log on Android. I want the app to use a calender and when the user clicks on a the box of the date they want edited, they are able to add an exercise and how many reps and sets they completed. My question is do I have to create a calender from scratch or is there a way to use one built into Android?
I have used TimesSquare before. It should work really well for what you are trying to do.

Application Time span control Android

I want to develop an app which user cant open after given days time or will pop up activity that time span is over .
I want to design an app. which user can use for 15 days after that user cant use its functionality.
For “normal” software a solution is to read the install date and add the time span. Then check on every start or resume the date. If the time is over show a dialog and finish app.
I know this is not really save solution if the customer knows it, so please don’t discuss about this. But is maybe a better solution than building two apps?

Categories

Resources