Introducing
Your new presentation assistant.
Refine, enhance, and tailor your content, source relevant images, and edit visuals quicker than ever before.
Trending searches
Next time on
Android Bootcamp:
Data and Communication
Last week:
This week:
1. Create a new function that will get the location info from a given image path
2. Use the built in Android class ExifInterface to retrieve the photos Exif geo information
3. With the retrieved locations create a new function that will calculate the distance between to latitude longitude locations (Hint. See the built in Location class)
4. Create a Toast to tell the user how far away they are from the Treasure!
1. In the TreasureListFragment override the method onActivityResult
2. Check that we are handling the right Result and Request
http://developer.android.com/guide/topics/media/camera.html#intent-receive
In our case the camera app can either take a photo or a video
1. Create a new function that is called from our onItemClicked Listener i.e. void takePhoto()
2. In this function create a new Intent specifying that you want to perform the action MediaStore.ACTION_IMAGE_CAPTURE
3. Create the file we want to save the photo to
4. Make sure you store this location so we can refer to it later!
5. Register the file location with the Intent (intent.putExtra)
6. Start the Activity
1. Go to the TreasureListFragment class and register an onItemClickedListener on the GridView we created previously
2. Store the path of the taken photo so we can use it later
To do this you will also need to have a reference to the TreasureListAdapter so that you can call the method getItem(itemPosition) to retrieve the selected photo path
Two types of Intents
Please add these two lines below to your applications build.gradle which is located here:
/AndroidBootcamp/build.gradle
1. Inside the dependencies block:
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.9.+'
2. And before the apply plugin: 'android' directive
apply plugin: 'android-sdk-manager'
Don't use implicit Intents for Services!
There is no guarantee which service will actually respond to your request!
Messaging object used to request an action from another app component.
How does the Android system know which Activities / Services provide which actions?
Exchangeable image file format
3. Optional: Create a ContextMenu instead
Use whats already installed on the phone!
Create an Intent which contains the action you wish to perform
All we have to do is
In Android if you want to give the user a brief message about something you can use something that is called a Toast message
If the Activity you sent the Intent to returns a result it will also use the Intent API to send the result back to you
Built in Location API (android.location)
To receive this result simply override the method onActivityResult
Google Play Services Location API
Use it if you
But...
design by Dóri Sirály for Prezi