0% found this document useful (0 votes)
22 views61 pages

Android Programming 2

The document discusses various topics related to mobile application development on Android including: adding new activities and passing values between them, sharing data with other apps, receiving intents from other apps, getting location updates, creating custom views, playing videos, and more. Key steps are outlined for tasks like creating intent filters, implementing location listeners, drawing 9patch images, requesting permissions, and playing audio/video.

Uploaded by

endrit hyseni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views61 pages

Android Programming 2

The document discusses various topics related to mobile application development on Android including: adding new activities and passing values between them, sharing data with other apps, receiving intents from other apps, getting location updates, creating custom views, playing videos, and more. Key steps are outlined for tasks like creating intent filters, implementing location listeners, drawing 9patch images, requesting permissions, and playing audio/video.

Uploaded by

endrit hyseni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 61

ICT training on MOBILE

Application Development
(Android) with Java
Virtual Classroom
Adding new Activity
Activity: Layout + Java code
Java snippet to start new Activity
Start new Activity and pass value!
Send a bundle with data
Receive the bundle from the new Activity
Sharing with other Android Apps
(sorry iOS)
Share Text with other Apps
Source code
Create an application that can receive data
from other apps?
1 st
Step
Create an intent filter in Manifest
2 nd
Step
Capture intent in “onCreate” function
3 rd
Step
Handle captured data
Android Geolocation
1 st
Step
Add permissions in Manifest
2nd Step
Request Location Updates,
Implementing “LocationListener”
Public Interface
LocationListener
3rd Step
Override “onLocationChanged”
function
How to stop location tracking?
Custom Views
1st Step
Create graphics and save them in
your “res” folder
2nd Step
Create the appropriate xml resource
file and place it in “res” folder
3rd Step
In your main layout file insert the xml
file as the button’s “background”
attribute
draw9patch
How to beep and vibrate
Only for vibration: Request permission
Beep through ToneGenerator
Beep through RingtoneManager
Vibrate!
Android Play a video!
1st Step
Create a VideoView in your layout file
2nd Step
If the video is a network resource,
request the appropriate permission
3rd Step
Play the video file inside the
VideoView
Stop the video?
Play from a local resource?

String SrcPath = "/sdcard/Video/myvideo.mp4";

You might also like