Threading in Android - java

I have just started Android Development, I want to make thread in my application which get the current location after every thirty seconds. Kindly give me some hints or any tutorial link which you think is useful for this problem.

Basically you need to create handler and update the gui every thirty seconds using that handler. For more info how to update the gui click here. For more info how the get the location read this android get location from best provider available

This is a good place to start. Note that if you are new to Android development you will find a lot of good resources at the Android website. Start there and maybe grab a good book on threads in Java, this one is very good book for that.

Related

Android - initial clicking tutorial

How to implement such a functionality in an Android application which presents to the user initial clicking tutorial (while running application for the first time)? It should look similar to how it is used in that application:
I've searched through forums, but did not find the answer.
I've already seen such a functionality in many other apps and its purpose is to show to the users the functionalities of the most important buttons/layout elements in the main activity of our application.
How to implement such a functionality? And how to indicate that user already completed "clicking tutorial" so it will not show for the next time?
Thank you in advance!
You can take a look at this library here ShowcaseView or here RoboDemo.
(I think "ShowcaseView" library is the one you're looking for)
Hope it helped.
TutorialView might fit your requirements.

Ideas for my app that runs in the background

I'm developing an app that runs in the background that essentially snaps a front facing photo every time the phone is successfully/unsuccessfully unlocked. This isn't an original idea, but I'm developing it as a final project for my college android programming course, with no intent to sell this app. I have a general idea how I am going to go about this via some research but I keep running across a problem.
I know that it is hard and bad practice to run an app continuously in the background, so the idea is you put the app to sleep and set an alarm. My problem is that if the would be phone-snooper were to get really lucky, they could access the phone in between the alarms, and the owner of the phone would never know. I talked with my professor, and he proposed a couple ideas, but we could not come up with a definite solution, so I'm asking opinions here. Any idea how to subvert this dilemma? Thanks a ton.
Your approach is probably not appropriate for the problem. You can't "time" unpredictable events (like someone attempting to unlock a phone). Or else it's not clear how you are setting the alarm.
You should change the approach to an event-based approach.
Either provide a service for a lock-screen app so that it can use your code to capture a pic by sending login attempt events to it. You write that and provide an SDK/API.
Or else create your own lock screen app with your feature:
https://stackoverflow.com/questions/10864300/create-a-lock-screen-of-my-own

The best battery saving method for Location updates

I'm trying to write an Adroid application that should run in background and notify the user when he will be close to the place given in the database. Should I do it by requestLocationUpdates in the extended IntentService class?
What is the best way to make it as least battery draining as possible?
Reto Meier has written extensively on this topic : http://android-developers.blogspot.in/2011/06/deep-dive-into-location.html
There is also a section on Optimizing Battery Life at the Android Developers site: http://developer.android.com/training/monitoring-device-state/index.html

Location listner in android background service

i have search alot to find how to implement the location listener in the Android background service but didnt find any proper answer. i want to run a thread in background service to find throughput and location together. can any body show me by writing small piece of code that can find these values.( a tested one).
thanks very much in advance
I've used "little-Fluffy-location" and it's great!
I can hardly feel the battery consumption, and it was easy to use.
http://code.google.com/p/little-fluffy-location-library/

i saw the code of starting other apps from my app.but i came to K little bit ..i need some detailed ebooks on intents and start activity

i saw the code of starting other apps from my app.but i understood little bit ..i need some detailed ebooks on intents and start activity ON ANDROID...
this is the book I used to learn about Android. It walks you through code and how to build apps but long before it goes into detail about the architecture and what you spefically asked for (intents and activities). It's really good and explains all the code and what each line does, and also helps you install and set up Eclipse (which I found to be quite difficult).
http://www.amazon.co.uk/Hello-Android-Introducing-Development-Programmers/dp/1934356565/ref=sr_1_2?ie=UTF8&qid=1289556713&sr=8-2
Hope this is what you meant by your question. Had a hard time understanding :P

Categories