When there’s no limit to what Android gets, there’s no limit to what Android does
Sebastian
This user hasn't shared any biographical information
Posts by Sebastian
Services – connect and communicate using aidl
Jul 31st
With services there are 2 ways to work with :
- One is to use startService(Intent) to start the service and stopService(Intent) to stop the service from within your activity. With this solution you cannot communicate directly with the service, but you can use SQLITE as a layer between activities and services.
- The second is to use bindService() to bind the service with the activity. With this the service is alive all the time the activity that is bind to is alive. With this method you can communicate with the service directly.
I will write a simple tutorial about the second option.
I use Eclipse and ADT Plugin for Eclipse . This will do some background work.
Add settings to an application using Preferences
Jul 10th
You can use Preference classes from Android SDK to store, set and retrieve Settings at application level or at activity level.
There are 2 ways to manipulate preferences :
- Using your own screen to modify the settings
- Using the built in PreferenceActivity class
How to share / send data from your application
Jun 29th
If you want to share / send data from your application using others applications, you must use ACTION_SEND intent.
An example below :
-
Intent intent = new Intent(Intent.ACTION_SEND);
-
-
intent.putExtra(Intent.EXTRA_SUBJECT, this.getResources().getString(R.string.shareSubject));
-
intent.putExtra(Intent.EXTRA_TEXT, this.getResources().getString(R.string.shareExtra));
-
intent.setType("text/plain");
-
-
startActivity(Intent.createChooser(intent, this.getResources().getString(R.string.mailAppChoose)));
If you want to choose only from e-mail applications use :
-
intent.setType("application/e-mail");
If you want to attach a file to e-mail use :
-
intent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+Environment.getExternalStorageDirectory()+"/"+fileName));
DRoute – Record your route
Jun 28th
With DRoute you can record your route with the help of GPS receiver.
The application will record position ( latitude and longitude ) , altitude, speed and orientation.
It will run in the background as a service while it’s in record state. You will be notified via notifications about service state.
After you record a route you can :
- average speed for selected route
- total distance for selected route
- total time spent on route
- view speed history as a graph
- view altitude history as a graph
- view the route on Google maps
- export the route in a .gpx file on the sd card or automatically attach to an e-mail
- upload .gpx file to a web server and share your route via Facebook, Twitter, E-Mail.
New version 1.2.3 :
- can split routes ( History -> Route list details -> long click on the record from which you want to start new route. As a result, a new route called Splited Route will be created.
- show orientation as : N, NNE, NE, NW, SSW, etc
- export/import now includes bearing
New version : 1.2.4
- can add tags to route, tags will be exported to web page
- add total distance and average speed to web page
New version : 1.3
- add install to sd card on Froyo ( Android 2.2 )
- filter by tag in History screen
Create a custom adapter
May 28th
If you want to create a detailed list you may need a custom adapter for that list.
With the solution below you can manipulate and populate your custom list.
1. extend ArrayAdapter<YourClass>
2. override public View getView(int position, View convertView, ViewGroup parent)
How to get string resources values
May 27th
In code :
getResources().getString(R.string.resourceName);
In xml :
@string/resourceName
DTrackTime – Monitoring your time
May 27th
DTrackTime is a simple and useful application that help you monitor your activities, tasks, meetings, calls, etc
In this first version it has only basic functionalities : Start – Stop, Pause – Resume, Add/Edit Clients, Add/Edit Projects, List all history, Export to CSV.
First steps :
- Add a client , only name required for the moment.
- Add a project for the client.
- Enter task/activity name
- Start recording time
- When go to lunch, or you want to pause the recording, simply click Pause, and then when you are back to work, click Resume.

