MusicDroid - Audio Player Part II
Introduction
In part one of the MusicDroid tutorial we created a simple MP3 player that will list all of the songs on the SD card and allow the user to select a song to play. Now, we will move the MediaPlayer object into a remote service. This will allow the music to continue in the background while the user is doing other things on their phone.
Click here to download the complete source to reference for this tutorial.
What are services?
Services are components that run in the background and do not display a view for the user to interact with. These components must be listed in the Androidmanifest.xml file with a <service> element. When the Activity that started the service is closed Android will attempt to keep the service running if possible.
To create a new Service you extend the android.app.Service class. Then for your activity to connect to the service it would call either Context.startService() or Context.bindService(). Attempts to connect to services are asynchronous, that means that after you call one of the functions to start your service your code will not wait for it to connect to the service before continuing on. Instead, you must pass in a ServiceConnection object, and then ServiceConnection.onServiceCon
Interacting with services
We need a way to send and receive data from the service to our Activities which are using this service. This is done using an IInterface class. It is quite complicated to create this interface, so Google has made it easy on us. They have created the "Android Interface Definition Language" or more frequently referred to as AIDL. So, to create an Interface for a service you just need to create an AIDL file in your src folder (the same folder with all your other classes), and when you save the .aidl file it will automatically generate a class that extends IInterface based on your AIDL file.
For the MusicDroid project we are going to create a service called MDService (Music Droid Service). We will call our interface for this service MDSInterface. Here is MDSInterface.aidl:
- package com.helloandroid.android.music
droid2; - interface MDSInterface {
- void clearPlaylist();
- void playFile( in int position );
- void pause();
- void stop();
- void skipForward();
- void skipBack();
- }
This is just a very basic outline of the functions that we will need to control a media player. Unfortunately, there are still some issues with AIDL and Interfaces, so you are kinda limited on the types of the arguments and return values. For example I would have liked to use a function "void setPlaylist( in List
Notice the that the arguments in the functions say things like "in String song". This signifies the direction of the data, ie you are are reading the value from song, not intending to write the value of song. You can use "out String song" if that was the case.
So when you save this MDSInterface.aidl it will create a file called MDSInterface.java which defines the class MDSInterface. In the class MDSInterface is the is a public abstract class called Stub, and this is what you must create a subclass of in your MDService class.
So, to make this a little easier lets look at the MDService class, with all of the MediaPlayer specific code pulled out for the time being so you can see how the interface is created:
- public class MDService extends Service {
- private MediaPlayer mp = new MediaPlayer();
- private List<String> songs = new ArrayList<String>();
- private int currentPosition;
- private NotificationManager nm;
- private static final int NOTIFY_ID = R.layout.songlist;
- @Override
- public IBinder getBinder() {
- return mBinder;
- }
- public void playFile(int position) throws DeadObjectException {
- try {
- currentPosition = position;
- playSong(MusicDroid.MEDIA_PATH + songs.get(position));
- Log.e(getString(R.string.app_name), e.getMessage());
- }
- }
- songs.add(song);
- }
- public void clearPlaylist() throws DeadObjectException {
- songs.clear();
- }
- public void skipBack() throws DeadObjectException {
- prevSong();
- }
- public void skipForward() throws DeadObjectException {
- nextSong();
- }
- public void pause() throws DeadObjectException {
- Notification notification = new Notification(
- R.drawable.playbackpause, null, null, null, null);
- nm.notify(NOTIFY_ID, notification);
- mp.pause();
- }
- public void stop() throws DeadObjectException {
- nm.cancel(NOTIFY_ID);
- mp.stop();
- }
- };
- }
The code above is everything that you need to implement the interface. You'll see first on line 40 the getBinder() function. This will return the mBinder variable that is defined starting on line 86. This mBinder variable is the MDSInterface.Stub class that you must create to define all of those functions in the AIDL file.
Tip: In Eclipse to make overriding all these functions easier you can type in line 86 and hit enter. Then in the empty block starting on line 87 you can right click and goto "Source -> Override / Implement Methods"
So, we are implementing all of these interface functions that we defined earlier in the AIDL file. First in playFile(int) we simply set the currentPosition and call playSong(String) passing in the path to the song. This is very similar to the functionality that was built into the MusicDroid ListActivity in MusicDroid back in Part 1.
Here is the the playSong(String) method:
- try {
- Notification notification = new Notification(
- R.drawable.playbackstart, file, null, file, null);
- nm.notify(NOTIFY_ID, notification);
- mp.reset();
- mp.setDataSource(file);
- mp.prepare();
- mp.start();
- mp.setOnCompletionListener(new OnCompletionListener() {
- public void onCompletion(MediaPlayer arg0) {
- nextSong();
- }
- });
- Log.e(getString(R.string.app_name), e.getMessage());
- }
- }
Note that this is almost identical to the playSong function from Part 1. However, those really paying attention will notice a difference on lines 47-49. As you see we are now going to create a notification each time a song plays.
To do this we will need to add 2 files to the res/drawable folder, playbackstart.png and playbackpause.png. Once they are added to the "res/drawable" folder they will be referenced by their int value for their id. The first argument for the Notification constructor in the top status bar icon to use. Since this is the playSong() function we want to use the playbackstart.png, which can be referred to as "R.drawable.playbackstart". For the second and fourth parameter we are passing in the filename, this is the text that will be displayed on the status bar animation.
After we create out Notification object we will use our NotificationManager to initiate the notification. this is done on line 49, with nm.notify(int,Notification). We pass in an int, NOTIFY_ID that we will use refer to this notification icon when we need to modify or remove it, along with the Notification that we created.
The NotificationManager is initialized in our onCreate() function, and we make sure to remove the icon with nm.cancel(int) when the service is destroyed in the onDestroy() function:
- @Override
- protected void onCreate() {
- super.onCreate();
- nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
- }
- @Override
- protected void onDestroy() {
- mp.stop();
- mp.release();
- nm.cancel(NOTIFY_ID);
- }
- @Override
- public IBinder getBinder() {
- return mBinder;
- }
We must also cancel the notification after playing the last song on the playlist in our very familiar nextSong() function that is moved into our new Service:
- private void nextSong() {
- // Check if last song or not
- if (++currentPosition >= songs.size()) {
- currentPosition = 0;
- nm.cancel(NOTIFY_ID);
- } else {
- playSong(MusicDroid.MEDIA_PATH + songs.get(currentPosition));
- }
- }
One last function that we have created is prevSong(). We saw it called above on line 107 to handle the work in skipBack() from the interface. Here is prevSong():
- private void prevSong() {
- if (mp.getCurrentPosition() < 3000 && currentPosition >= 1) {
- playSong(MusicDroid.MEDIA_PATH + songs.get(--currentPosition));
- } else {
- playSong(MusicDroid.MEDIA_PATH + songs.get(currentPosition));
- }
- }
This function is designed to for the skip back functionality that will be shown in Part 3. The idea here is that if you hit the skip back button in the controls then your song will restart, and if you hit it again then it will go the previous song. So here we go to the previous song if we are less than 3 seconds into the song, and we are not listening to the first song on the list (position 0).
So there you have it, a service to handle everything. On the next page we will look at how to bind to this service, and the changes that we need to make to the MusicDroid class to use the new service...
Using Services
In order to use a remote service first we must add a line to our AndroidManifest.xml file inside our application tag to define our service, here is that line:
<service":remote"
Now we can use this service in our MusicDroid ListActivity class that we created in the previous tutorial. We will now try to bind to our newly created service in the onCreate(Bundle) function of our ListActivity:
- public class MusicDroid extends ListActivity {
- private List<String> songs = new ArrayList<String>();
- private MDSInterface mpInterface;
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.songlist);
- this.bindService(new Intent(MusicDroid.this,MDService.class),
- }
- }
We are binding to our service using a new Intent object, and we are creating the Intent object using the direct reference to a class. You could use a Action and Category to bind to a service also, but for this we can just refer to it directly. We pass in the mConnection variable, this is a ServiceConnection object, and when the service is connected it will call the mConnection.onServiceConnected
- private ServiceConnection mConnection = new ServiceConnection()
- {
- public void onServiceConnected(ComponentName className, IBinder service) {
- updateSongList();
- }
- public void onServiceDisconnected(ComponentName className) {
- mpInterface = null;
- }
- };
So, when the service is connected we can initialize our mpInterface class on line 74. Now that we have this mpInterface class we need to populate the playlist by adding each song using mpInterface.addSongPlaylist(St
- public void updateSongList() {
- try {
- mpInterface.clearPlaylist();
- if (fileList != null) {
- songs.add(file.getName());
- mpInterface.addSongPlaylist(file.getName());
- }
- ArrayAdapter<String> songList = new ArrayAdapter<String>(this,
- R.layout.song_item, songs);
- setListAdapter(songList);
- }
- } catch(DeadObjectException e) {
- Log.e(getString(R.string.app_name), e.getMessage());
- }
- }
This function is pretty much identical to it's first incarnation in the previous tutorial. The only thing we needed to add is the mpInterface.addSongPlaylist(St
And lastly, we must play a song when a user clicks on a song, so here is that method:
We simply use the mpInterface.playFile(int) method that we designed earlier in this tutorial.
So now we have a playlist ListActivity and a Service to handle playing the music, but we still have no way to control the music. In the next section we will create a graphical user interface for the controls, introducing ImageViews and Animation...
New tutorials from Helloandroid
Recent Apps
Android on Twitter
-
@619Apps (iPhone App Developer)'Xperia Sola' trademark hints at another possible Sony handset for the U.S. - http://t.co/atxhdfFz #iPhone #android #apps
2 hours 23 min ago -
@ayakaarchdia233 (Love)I've just received an achievement: Discriminating Shopper https://t.co/LDVOSV6I #Android #Androidgames
2 hours 23 min ago -
@DevrynBluelagon (Devryn Bluelagon)I've just received an achievement: Novice Photographer https://t.co/NpjOoveN #Android #Androidgames
2 hours 23 min ago -
@games_lma (leila marie ashley)I've just received an achievement: Persistent Shopper https://t.co/vTs6DSor #Android #Androidgames
2 hours 23 min ago -
@hawkhugh (hawkhugh)Apple's iPad3 http://t.co/T9dSUJA9 #apple #ipad3 #iphone #android
2 hours 23 min ago
Poll
Useful resources
Android Development Projects
- Android App: GPS: Form: Database: Website by danishayubb
- Jquery Mobile Project 01 by menfirst
- Simple Android App to load our Mobile Site - Hiring NOW! by steadysystems
- mobile app by ultimaterrrr
- android apps by vaneet08
- Online food shopping app (anroid) by akshaynawale
- Android eBook / reader Application by bamohriz
- Android app 50k downloads by nhcteam
- Beautiful Android Live Wallpaper by wahid2o11
- App downloads by nhcteam




Comments
دردشة سورية دردشة
دردشة سورية
دردشة لبنانية
دردشة عراقية
شات سوري
شات لبناني
دردشة سوريا
دردشة لبنان
شات سوريا
شات لبنان
دردشة السويدي
منتديات السويدي
اغاني عراقية
صور فنانين
الرياضة العراقية
شعراء العراق
نغمات عراقية
اغاني عربية
اغاني كردية
دردشة عراقية
دردشة بنات العراق
دردشة صبايا بغداد
دردشة البصره
دردشة بغداد
دردشة بغدادية
دردشة صبايا بغداد
دردشة شباب العراق
دردشة بنات العراق
دردشة الكرادة
دردشة دمشق
دردشة بيروت
دردشة حلب
دردشة حلب
دردشة عراقية
دردشة العراق
شات عراقي
جات عراقي
دردشه عراقيه
دردشة صبايا لبنان
دردشة بنات لبنان
شات صوتي | دردشة صوتية | كلام
شات صوتي
| دردشة صوتية
|
كلام
| شات كلام
|
دردشة كلام
| دردشة صوتية
|
شات صوتي
| شات
|
Chat Voice
| ahj w,jd
شات صوتي
| دردشة صوتية
|
شات صوتي
| دردشة صوتية
|
دردشه
| دردشة
|
صوتي
| صوتية
|
شات صوتي
| دردشة صوتية
|
شات صوتي
| دردشة صوتية
|
الكلام
| دردشه صوتيه
|
]v]am w,jdm
| ]v]ai w,jdi
شات صوتي
شات صوتي
شات صوتي
thanks
روابط واعلانات نصية
نص
ديزاين -
معهد
دليل مواقع مرقاب حائل -
دليل مرقاب حائل
توبيكات حائل -
تحميل حائل -
شات حائل
حائليات -
حايليات
منتديات حائل -
منتدى حائل -
حايل -
حائل
أول -
حبيب -
أول حبيب - قصص الانبياء عليهم السلام
good sites....
The Post Is Written in a very good manner "and it" entail Many Useful information for me. I Appreciated What You Have Done here. I am Always searching for informative information like this.guitar lesson software
aglla
nice topic
شبكة اغلى
موقع نواحي - دليلك الشامل
فينك حبيبي
aglla
nice topic
شبكة اغلى
موقع نواحي - دليلك الشامل
فينك حبيبي
Graeat to hear about
Graeat to hear about 'MusicDroid feature. That is really great info you have shared. I was not aware of this. I learnt from your post here. Thanks for the great update news.
joomla development companies | joomla web development | register domain in india
You have to admit that the
You have to admit that the best kind of humor is making fun of other people. This might sound mean, but nobody can deny that it’s the absolute truth. The reasoning behind it is simple. People can relate to other people. If you like to laugh at others misfortunes, check out funny videos of people online.
Thank you - the site very
Thank you - the site very very nice
شات الحب - شات مصري - شات بنات مصر - شات صوتي - دردشة مصرية - شات مصرية - شات حب - شات - دردشة - Chat - love chat - دردشة الحب
nice
Congratulations for a fantastic job. There’s no doubt that your visitors will likely want far more content such as this carry on the great content… about MusicDroid - Audio Player Part II..Digital SLR
new service
To create a new Service you extend the android.app.Service class. Then for your activity to connect to the service it would call either Context.
precio audi a3
thanks
thanks for your article its really great and useful
sportbike specifications SKEMA RANGKAIAN Electronic Circuit scolarship wireless car specifications gadget and computer car first look Motorcycle Modification sexi-stars. newlaptop circuits-audio electronic projects auto girl weapons system science kids gadget bikes walpaper mobil-wallpaper MODIFIKASI MOBIL plane-wallpaper celebsexypict artist-scandal sport-cars bikespict motor-modify sexi-model laptopharga gambar-artist fast-superbike autoshowmodel harga-kamera notebook-price diamonds-collections phones-gallery camera-prices home-pic audio-gallery autocarpict living-cares homes life-style
exciting!!!!
Its really exciting!!
Latest fashion clothing
New jewelry accessories
Cubic Earrings
Long necklaces
can you please give me the
can you please give me the link of part one as i missed some steps of this application for my android phone.
Hindi Movies
thank you for information حجز
thank you for information
حجز فنادق مكة
فنادق مكة
There are certainly a lot of
There are certainly a lot of details like that to take into consideration. That is a great point to bring up. I offer the thoughts above as general inspiration but clearly there are questions like the one you bring up where the most important thing will be working in honest good faith. I don?t know if best practices have emerged around things like that, but I am sure that your job is clearly identified as a fair game. Both boys and girls feel the impact of just a moment’s pleasure, for the rest of their lives.
myegy
ماى ايجى
ماي ايجي
my egy
nice
This really is this kind of a good resource that you are providing and also you give it away for
websites for contractors
absolutely free. I take pleasure in seeing sites that realize the worth of providing a prime resource for totally free. I really loved reading your post. Thanks! contractor websites
nice
It is a very profitable post for every one interested in this language of querypath and character sets used to converting the content. I've enjoyed reading the useful post. keep it up.
Swimwear
This post is exactly what I
This post is exactly what I am interested. keep up the good work. we need more good statements. Please add more good information that would help others in such good way.
Strawberry flower
Property Investment
You could use a Action and Category to bind to a service also, but for this we can just refer to it directly. Property Investment We pass in the mConnection variable, this is a ServiceConnection object, and when the service is connected it will call the mConnection.onServiceConnected method, and when disconnected it will call mConnection.onServiceDisconnec ted.
I am glad to learn about the
I am glad to learn about the audio player part II doing its job while you are engaged in other activities in phone. It is really an exciting feature to listen music in the background. thanks. doctor krauss
nice
More than meters and fashion mobility, the smart grid represents a whole new framework for improved managem ent of electric generation, transmission and distribution. upright bagless vacuum cleaners
Cool
This is a brilliant idea. I like to do so. I often listen to music.
dietas para emagrecer and emagreça com saúde and dieta equilibrada
The words you need by the
The words you need by the people you admire, such as the: Character cannot be developed in ease and quiet. Only through experience of trial and suffering can the soul be strengthened, ambition inspired, and success achieved. cold steel spartan
auto insurance michigan
Thanks for the nice blog. It was very useful for me. Keep sharing such ideas in the future as well. This was actually what I was looking for, and I am glad to came here! Thanks for sharing the such information with us.
diseases.disease,diseas
I am developping some client server application. I am confused whether i will design the connection class as service or simple java class which takes care of http connection, sending and receiving data.
Diseases,disease,diseas
General Health
Disease and Treatment of Cancer
Women's Health and Diseases
Skin Health and Skin Diseases
Sexual Health and diseases
Now i am not exact with this, but isnt it looking for it in layout, and if so i dont have it there so maybe that is the issue
marvelous source of info about MusicDroid
Good Job of acknowledgment and a marvelous source of info about MusicDroid.........Thanks Admin!
AC
Cooling System
Best Cell Phones
Home and Kitchen Appliances
Online Free Games
I has downloaded code
I has downloaded code MusicDroid2 , but i set up in emulator and result est fail
GSM Kampanya | Bilişim Teknoloji | Cep Telefonu | Turkcell Kampanyaları | Avea Kampanyaları | Vodafone Kampanyaları
اي فون, ايفون 4, سعر اي فون
اي فون, ايفون 4, سعر اي فون 4, برنامج ايفون, IPhone
اي فون
اي فون 4
ايفون 4
ايفون
سعر اي فون
برنامج ايفون
IPhone
اي فون, ايفون 4, سعر اي فون 4, برنامج ايفون, IPhone
اي فون
اي فون 4
ايفون 4
ايفون
سعر اي فون
برنامج ايفون
IPhone
اعلانات عرب اي فون
اي فون
اخبار اي فون
برنامج اي فون
العاب اي فون
ثيمات اي فون
خلفيات اي فون
نغمات اي فون
اكسسوارات اي فون
سعر اي فون
منتدى الاي فون العام
اي فون
اي فون
اي فون
اي فون
اي فون
اي فون
It is very very exciting
It is very very exciting about the new features of musicdroid audio player. How interesting it is to continue with your own work at the same time listen to your favorite music in the background. It is a mind refreshing post. real estate evansville
free hoa websites
I decided to find more information about this topic on your website. So thank you very much again for the post great interest and maintain the publication of this detailed information in the near future as well.
free hoa websites
Thank you for
I thank the very Code, which provides management services Almmmezp each member who participates Bmodia deals and the progress of the new and more Thank you
قياس درجة الحب
قران
الماسنجر
مطبخ الاسرة
ارشفة المواقع
بيج رانك
استعلام عن الاى بى
اكواد الالوان
اضرار التدخين
اتصل بنا
تقسير القران
قصص الانبياء
مسجات الجوال
عالم الابرامج والفلك
احسب عمرك
رنتك باسم حضرتك
خواطر ادبية
مركز تحميل
راديو محطة مصر
معانى الاسماء
توبيكات بحبك
العاب بحبك
يو تيوب بحبك
شات لبنان
شات الكويت
شات الاردن
شات البحرين
شات ليبيا
شات المغرب
شات فلسطين
شات قطر
شات السودان
شات سوريا
شات تونس
شات الامارات
شات اليمن
شات الجزائر
شات السعودية
اختصار روابط
شات
Similar program... with problems
Hi, friends,
great tutorial. I've been using it as base... but not completly successfully. Can anybody help me?
I'm doing a task that can take very long (varies from a few seconds to a couple of hours), so I though of a service to make the task and an activity to start/stop/monitor. Exactly the same than with an MP3 player!
However, when I rotate the screen, the activity is destroyed/created (this is not a problem), and so it is the service! (this _is_ a problem, because the new service is a different service, with a different state). I want my service to survive the destruction of the activity.
1) Am I asking for something impossible? It is hard for me to believe it, because what I want is exactly what this music player wants...
2) if (impossible) { Any other idea? }
3) else { Any idea of what I am doing wrong? }
Edit1: I forgot to say thta I'm using Android 2.2 (API 8)
Here is my pseudocode
// THE SERVICE
class MyService extends Service {
private MyInterface.Stub binder = new MyInterface.Stub() {
public int getProgress() {...}
public void doStop() {...}
}
onCreate() {
Log("MyService created");
}
onDestroy() {
Log("MyService destroyed");
doStop();
}
onBind() {
Log("MyService bound");
return binder;
}
onStartCommand() {
(new Thread() {
void run() {
while (!stop) {
//Do long task
}
stopSelf();
}
}).start();
}
}
// THE ACTIVITY );
class MyActivity extends Activity {
MyInterface _service;
ServiceConnection conn = new ServiceConnection() {
onServiceConnected(s) {
_service = MyInterface.Stub.asInterface(s
}
onServiceDisconnected() {
_service = null;
}
}
onCreate() {
Log("MyActivity created");
bindService(MyService, conn);
}
onCreate() {
Log("MyActivity created");
unbindService(conn);
}
clickStart() {
startService(new Intent(this, MyService));
}
clickStop() {
_service.doStop();
}
clickProgress() {
_service.getProgress();
}
}
// THE MANIFEST
hi
Technically, it is true that the MP3 format is not supported natively gapless encoding (and yes, Ogg, WMA and other formats few do).But in practical terms, when LAME is used for coding and labels no spaces are included, any decoder that will read the tags LAME gapless playback (and any player on any platform that does not understand the labels LAME should be pursued in forgetting).
Forex Robots
how to win the lottery
I am extremely to learn about
I am extremely to learn about this service tutorial on this musicdroid audio player part ii. It is so exciting to learn about the special feature. Nice information. keep it up. meet single online
software system review
I've been searched this kind of information for quite a while.I really enjoyed this article and wish more contents on the topic.
software system review
I tried this tutorial, but couldn't make it work. Today I tried
I tried this tutorial, but couldn't make it work. Today I tried to write my own base on the tutorial (essential the same - but no Notifications ) - it works ! So I review the code, and see the initialization of NotificationManger nowhere. May be you should add: ICATION_SERVICE
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIF
سيرة الرسول
سيرة الصحابه
أحكام الدين
اناشيد اسلاميه
اناشيد اطفال
المنبر الحر
مواضيع ساخنة
اخبار
وظائف
مدونات
منتديات تعليمية
المرحلة الابتدائية
المرحلة المتوسطة
المرحلة الثانوية
التعليم العالي و الجامعي
كتب الكترونية
كتب مجانية
فساتين
أزياء
تسريحات شعر
قصات شعر
صبغات شعر
مكياج
جمال الجسم
عطورات
زفات
ديكور
أطباق رئيسية
صحة الأنسان
قصص
روايات
روايات
طويلة
صور
رسم
سياحة
نكت
العاب الكترونية
اخبار رياضيه
تغطية مباريات
منتدى جمهور النصر
منتدى جمهور الهلال
صور سيارات
صور للتصميم
خلفيات
برامج جوال
رسائل
الايفون
منتديات البلاك بيري
اخبار البلاك بيري
العاب البلاك بيري
برامج البلاك بيري
برودكاست بلاك بيري
خلفيات بلاك بيري
ثيمات
البلاك بيري
برامج ماسنجر
توبيكات
صور ماسنجر
ثيمات ماسنجر
خلفيات
ماسنجر
رموز ماسنجر
ابتسامات ماسنجر
ايقونات ماسنجر
منتديات
منتدى
ngrusui
your post looks very interesting for me, Great blog! I am loving it!! Will come back again. I am totally excited about this blog
foto gadis smu, camera,komputer game, film, Pencairan Es Greenland
Thanks for continue to
Thanks for continue to sharing, Web Hosting, Web Hosting Murah - VPS - Domain Murah, Web Hosting - VPS - Domain , Info Jogja, Yogyakarta, jogja, Seputar Wedding, Web Hosting Murah - VPS - Domain Murah, vegetarian recipe, Gadget Review
Informative site
This is a very informative article.I was looking for these things and here I found it. I am doing a project and this information is very useful me. If you are interested, but this is my duty to inform you that virtual administrative assistant a very dedicated service and can be applied anywhere you want and get better results.
World of Warcraft Gold
Thanks for this
to create a simple audio player which doesnt shows the list on start.
And i dont want to use the aidl file .
| Perlunya Web Komunitas Event Organizer
| Perlunya Web Komunitas Event Organizer
| kedaiobat.co.cc
Notification manager is not initilized ?
Hi, ICATION_SERVICE);
Yesterday I tried this tutorial, but couldn't make it work. Today I tried to write my own base on the tutorial (essential the same - but no Notifications ) - it works ! So I review the code, and see the initialization of NotificationManger nowhere. May be you should add:
NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIF
Hope it helps !
Son
Edit:
My mistake, the NotificationManger is already initilized in onCreate(). But there's something with the Notification at line #47:
I am programming with Android 1.5, it is an syntax error, I researched some text from: http://developer.android.com/g uide/topics/ui/notifiers/notif ications.html
and I replaced it with:
Then it works !
Hope it helps !
state
The state’s Oil Spill Administration Fund is fed by a five-cent per barrel fee on crude oil unloaded at California ports. “The OSA is already underfunded,” said No on 26 spokeswoman Heidi Pickman. “Think what it will cost 20 years down the line toPing Golf or respond to oil spills. Someone’s going to have to pay for it, and if it isn’t Chevron, it’s the taxpayers.
Stop Korupsi dan Suap di Indonesia
wow.. part 2... i like
Stop Korupsi dan Suap di Indonesia, BlogKlik, Kontes Seo and Kontes SEO
ash
short tutorial on how to populate your android list view, with data downloaded from the internet or internet dating, using ArrayAdapter. ListView items view is declared in a separate XML file and displayed using custom adapter class.
informative site
It is true that the MP3 format is not natively compatible gapless encoding (and yes, Ogg, WMA and other formats few do). But in practical terms, when used LAME for encoding tags without spaces and including any decoder to read labels LAME gapless playback (and any player on any platform that does not understand the labels LAME should be carried out in forgetting). Despite Apple's efforts, MP3 file format by far the most common and portable audio loss and the LAME encoder is probably the most common (by the way, apart from iTunes and WMP), so in my humble opinion this is a better alternative to Ogg encoding music files without interruption. World of Warcraft Gold
You have so much knowledge
You have so much knowledge about this issue rumah mungil yang sehat | bisnis syariah @
it really compensated for my
it really compensated for my time rumah mungil yang sehat | bisnis syariah @
it is sometimes hard to
it is sometimes hard to Pandora in a world of adults Pandora Bracelets
Very Cool
like i said on other parts it's very coool..
West Bengal Election State assembly election 2011
Cricket World Cup 2011
Cricket World Cup 1987
1983 Cricket World Cup