When I searched in Google on how to get the current location in Android, I came across ┬áthe page in Android’s documentation about connecting to Google Play Services and initializing it.

I found out this was really not needed. If I could get the location without having to use this, all the better right?

User MrJre from the StackOverflow forum provided this very handy, useful, clean and non-Google Play Services type of code.

All you need are some broadcasters, receivers and listeners. This is how I did using some of his code. The code will try to get locations through GPS or WI-FI in case one or the other fails.

First off, place this code in a class.

Then create a broadcast class that will fire events to all listeners when a location has been found.

Next, create a listener for use in any Activity that may use location tracking.

All classes are now in place. The next thing to do is to implement the listener to your Activity.

In the onCreate() method, the fetchLocation() method is called and once a location is found, the broadcaster will fire the gotLocation() method to all listeners and return a Location object.

That’s it! And without having to use Google Play Services to get a location object.

eye-fi

This is a Sponsored Post written by me on behalf of Eye-Fi. All opinions are 100% mine.

I saw it and I never could have believed it. The Eye-Fi card is just perfect for me. I take many photographs of any kind and most of the time, I feel lazy having to find my card reader, plugging it in, placing my card, transferring my files and putting the card reader back in place. I know, you may think that is nothing. But convenience is what I am after.

Technology has evolved in so many ways that the way to go is through wireless. Eye-Fi can do a many things like automatic backup of your memories and automatic organization by date on your computer. The card storage memory is available up to 4GB within built in Wi-Fi. Once your camera is on, you can effortlessly and seamlessly transfer your photos and videos from camera to PC and even famous social networking sites like Facebook.

There is even no need to turn on your computer to transfer your files to sites like Facebook and Flickr. You can do so directly and all you need is to have a wireless router and a SDHC camera. Check out the video to see more what other things the Eye-Fi can really do. Oh yeah, one more thing. I was not surprised upon learning that the Eye-Fi was the winner in the Consumer Electronics Show a few years back. This technology is awesome!
SocialSpark Disclosure Badge

Related Posts Plugin for WordPress, Blogger...