diff --git a/android/res/drawable-hdpi/notification.png b/android/res/drawable-hdpi/notification.png
new file mode 100644
index 0000000000000000000000000000000000000000..84d65662c3c0d04b2f04a6d1fda7e79fceb5da0b
GIT binary patch
literal 1905
zcmV-%2afoOP)<h;3K|Lk000e1NJLTq001Tc001Tk1^@s6s6FYf00001b5ch_0Itp)
z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2igl1
z5Fi;k6H6ih000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000KeNkl<Z
zSi`-SdyG|A6~=#SpL1XHf;$Ya0ihi$h!%?&25Qg}!K6@1O9Q4NwiQVUDOCZRsu+S=
zO<?}e)@s_?M?!4_@qw{rNDx7p7#l{g$U`yCm@30d=oE&z&vW+jkA3ej!#uph4DRI1
zxw&WWwbxne`_|f9JOiP{_dP0S)=?exiCe{>{C|dk5o|6XbEJiL14~E5BM`s`YF~Ps
z`{#a?d&<ff1xS};ZXuoltDx$h!{)dEps5rWn~u=9`dM}XXMLdZxwS0$%tE$QRFlN(
zy|6O{XZ`~<BVj}Zm?#hqqjNZWwd0tT4+z&j$LnVH6q561vADdNB))S*1x4KN6D=_3
z5tz0dY8SzR$6!YzSPSar!Vu84mk;IDRL`qtas3BKny62rqKq0bE=}svB!wscItRyF
zVbv1&RfGGu6`SC5--N4Io&Dmv8$od|RS*v<%NZSukT9XeSP%rR&2_NA?Au}4eE4+}
z<OA6MJZxD5JNCl52KQfK?NFfrR*}$Rj23yKf~bhNCsN2$vP$^TlQ4f4tlSJQ`~o&V
zDy+C0cJ76Jhd?|jt{)1-@xn#N^iaoj5I2u8NqA+8uwV{6`3$^qP+4^!Wb?4=fa8ZS
zG_G}_FbpouU1gvzgev$R?EJ2<Vj-;C3Qb3xfq$QOic<PtUn*27D8bdRLV{&L`KyA6
z^3+=4V!QI~pSb^%m4I;{Hq@a-C3TNj@x?%}2qP+mA3R~0In71BZbCQm%h1r>7sEg#
z>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nT%;ezv<p2>7sGV|y&i^KPMAGC%9v`8U;Z{j
zX#1X9Jg|1D(qgdIV7WO%1j@?{v!=(`e<;hUr4@`C>Ghgt09)X>uN3;Enqj%=^f#__
zT4qd*vZJw+GZ&R)mFe@AWL41~2St}o9ZUx(1(Aqh&mS^;W!t;7owpbxoIY>+nyW=W
z0DNP_sv5P{pn?p48ihm0vi$Mw3>67OK2XZy9#&27sS2v9#)$PpE9q3mv<IQr{W7OL
zFYGry(m7ap???_DO4HbsV(EfPrcX(@<J0wfSx9BHJ+zYc|I(UkZ$2J2){KhOC#t9t
zBMg^Q06_q^)W+EL%p@*%SjN`)_@>8gN&wU<=__1rJ|6Bq+L~(@z%NTgCVcA)W0&7C
zHF9?>CL>jcKc&Vvbz0l|iYJ0*v-;lAQ@K4`Ub*n|&UC&_BEFCh)KA1r)wD^mks>5)
r9|X9W!||N-$#=5vWpegP#FyZ|DJjeXjPe4k00000NkvXXu0mjfB&3Ln

literal 0
HcmV?d00001

diff --git a/android/res/drawable-ldpi/notification.png b/android/res/drawable-ldpi/notification.png
new file mode 100644
index 0000000000000000000000000000000000000000..22ba84b3222cfc8f4346217604f522d03e2809bc
GIT binary patch
literal 883
zcmV-(1C0EMP)<h;3K|Lk000e1NJLTq000vJ000vR1^@s6a!@wR00001b5ch_0Itp)
z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2igl1
z5FrAoZL^O6000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}0008cNkl<Z
zILn2U%ZnU!5XV1Nzn-4y>78U{!9?QbD2dS!G6r2A5pwY`5HA`cM!k3t2?0SA{{wRr
z@ho1&gMy&qThNV<7$3MA1tE?mSu_~j-N`)qSLLC5c9M17{lSOsLse1VddY+LkRNI@
zmu1YlBSnN>A6iWi0cYc<f?v5p_k+{SCx_bHaje7ZQ(MSU`0x~*{t2#|hQkLzYit^E
zWr-Ds`?Zm=b7~8@E1>wo@9@cYF#jVwei8}?0=TY=yF%U~&oXwZIRXNRyNNv3fw{fV
z-VNu@!`q($LBQ8VKpX^fM8~Nbh&ePf;lxql{V(9$1-N(#5HS81S*@SD;8nivikZ^P
zloy{>F8u?`Jt_5|*Vz3R83&`Js&x?|ofaA?y!$zvS%9ErhGUym#=b77BSa6F>s18k
zDFQswQC@o0=q?JEmy{x|wN;`A93gQ8cfouzR3elG7P#%^z?rjf^ts6XUCLAwo_HXz
zeWp}I)dHuIX=B}#m@Cu*X#(H;49h*3%7lB{N<CHH_{fPisiRdjOUmK}%+^feNZ7Y4
z;jK@Nrys2Y@XQN+?%W%QCPWKp)kkq~H`EXcR|>TJR;&z#Cy%7O_Flo)XJPh+guC|D
zc;(H=!FGy^UgKv7YNl9Buoy6#Fc=2*@2>OIv5e<m9?&`7<Bvt*$bEJG`dcQpF_iwM
zBu1d{fcZK*C~*9toQFG2>Zvf@62AYX;N!1G+;UT(UMrhaj#VJBN`Ks7nOk|a(0$mk
zP5Etcz{Nj>9oqu{!6BNU=AjA}JX-a?hN2=`pq?h&xUI%Jr-mRCKl4E1u3p51=q{B|
z+34K-@au^AZ--nz6Nr|05nbE_clD${)b8b_(9d&efXHUIYo-;reNT%6w>B6JYT`J{
zE8g!9v@3`2-kKlS)0nH(m@UuI=5H`G>Zz_?+R=#amka&*e*uYBo{81^sd)eZ002ov
JPDHLkV1l}1nhF2_

literal 0
HcmV?d00001

diff --git a/android/res/drawable-mdpi/notification.png b/android/res/drawable-mdpi/notification.png
new file mode 100644
index 0000000000000000000000000000000000000000..0221d4fdd90e6e1068ca03cbc258239ce74bd4f1
GIT binary patch
literal 1164
zcmV;71atd|P)<h;3K|Lk000e1NJLTq000>P000>X1^@s6#OZ}&00001b5ch_0Itp)
z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2igl1
z00j-y9PG#d000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000B$Nkl<Z
zN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X&Br&b5_=@mm>0VVY*KR0#H@DLD;Q%*_f>Zfsig|#l
z@QEvl@xRCXIgLze3!FGp=HdC-AzxMDL3}8^`alBRy~d)a`{|gKrRSny3@=vz#3L0g
z7E1vQ)NvwJJ3;^>msPsY$81>BN;wHsd#GFj6)i@6m#w$^5Bq%X%!bYo>Wl%*p4P;^
zty58jLcW1`&~II(emh?}+IPu%1w@u~G)<d&cbJiwr}wTph69nN=SFoIh~Pn`*ncJI
eJ#lv6um1oo?vdi1kZi610000<MNUMnLSTY!g%3CY

literal 0
HcmV?d00001

diff --git a/android/res/layout/statusbar.xml b/android/res/layout/statusbar.xml
new file mode 100644
index 0000000..1530537
--- /dev/null
+++ b/android/res/layout/statusbar.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
+	android:layout_width="match_parent" 
+	android:layout_height="match_parent" 
+	android:orientation="horizontal">
+
+    <LinearLayout android:layout_width="match_parent" 
+    	android:layout_height="wrap_content" 
+    	android:orientation="vertical">
+    	<LinearLayout android:layout_width="match_parent"
+	    	android:layout_height="wrap_content"
+	    	android:orientation="horizontal">
+	
+	    	<ImageView android:src="@drawable/notification"
+		    	android:paddingLeft="4dp"
+		    	android:paddingTop="2dp"
+		    	android:paddingRight="4dp"
+		    	android:paddingBottom="0dp"		    	 
+		    	android:gravity="center"
+		    	android:layout_width="wrap_content" 
+		    	android:layout_height="wrap_content">
+		    </ImageView>
+		    
+	        <TextView android:id="@+id/title" 
+	        	android:textAppearance="?android:attr/textAppearanceMediumInverse"
+	        	android:gravity="center"
+	        	android:textStyle="bold" 
+	        	android:focusable="true" 
+	        	android:ellipsize="marquee" 
+	        	android:singleLine="true" 
+	        	android:layout_gravity="left" 
+	        	android:layout_width="wrap_content" 
+	        	android:layout_height="wrap_content"/>
+    	</LinearLayout>
+
+		<LinearLayout  android:layout_width="match_parent" 
+	    	android:layout_height="wrap_content"
+	    	android:paddingTop="0dp"
+	    	android:paddingLeft="10dp" 
+	    	android:orientation="vertical">
+	        <TextView android:id="@+id/content_line1" 
+		        android:textAppearance="?android:attr/textAppearanceSmallInverse" 
+		        android:layout_gravity="left"
+		        android:scrollHorizontally="true" 
+	        	android:singleLine="true" 
+	        	android:paddingTop="0dp"
+		        android:ellipsize="marquee" 
+		        android:layout_width="wrap_content" 
+		        android:layout_height="wrap_content"/>
+	        <TextView android:id="@+id/content_line2" 
+		        android:textAppearance="?android:attr/textAppearanceSmallInverse" 
+		        android:layout_gravity="left"
+		        android:scrollHorizontally="true" 
+	        	android:singleLine="true" 
+		        android:ellipsize="marquee" 
+		        android:layout_width="wrap_content" 
+		        android:layout_height="wrap_content"/>
+		</LinearLayout>
+    </LinearLayout>
+</LinearLayout>
\ No newline at end of file
diff --git a/android/src/org/rockbox/Helper/RunForegroundManager.java b/android/src/org/rockbox/Helper/RunForegroundManager.java
index eb6e4c9..0b3abe7 100644
--- a/android/src/org/rockbox/Helper/RunForegroundManager.java
+++ b/android/src/org/rockbox/Helper/RunForegroundManager.java
@@ -12,6 +12,7 @@ import android.app.PendingIntent;
 import android.app.Service;
 import android.content.Intent;
 import android.util.Log;
+import android.widget.RemoteViews;
 
 public class RunForegroundManager
 {
@@ -25,34 +26,32 @@ public class RunForegroundManager
 
     public RunForegroundManager(Service service) throws Exception
     {
+        mCurrentService = service;
         mNM = (NotificationManager)
                         service.getSystemService(Service.NOTIFICATION_SERVICE);
-        /* For now we'll use the same text for the ticker and the 
-         * expanded notification */
-        CharSequence text = service.getText(R.string.notification);
-        /* Set the icon, scrolling text and timestamp */
-        mNotification = new Notification(R.drawable.icon, text,
-                System.currentTimeMillis());
-
-        /* The PendingIntent to launch our activity if the user selects
-         * this notification */
+        RemoteViews views = new RemoteViews(service.getPackageName(), R.layout.statusbar);
+        /* create Intent for clicking on the expanded notifcation area */
         Intent intent = new Intent(service, RockboxActivity.class);
-        PendingIntent contentIntent = 
-                PendingIntent.getActivity(service, 0, intent, 0);
+        intent = intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+
+        mNotification = new Notification();
+        mNotification.tickerText = service.getString(R.string.notification);
+        mNotification.icon = R.drawable.notification;
+        mNotification.contentView = views;
+        mNotification.flags |= Notification.FLAG_ONGOING_EVENT;
+        mNotification.contentIntent = PendingIntent.getActivity(service, 0, intent, 0);
 
-        /*  Set the info for the views that show in the notification panel. */
-        mNotification.setLatestEventInfo(service, 
-                service.getText(R.string.notification), text, contentIntent);
-        
         try {
             api = new newForegroundApi(R.string.notification, mNotification);
         } catch (NoSuchMethodException e) {
             /* Fall back on the old API */
             api = new oldForegroundApi();
         }
-        mCurrentService = service; 
     }
-    
+    private void LOG(CharSequence text)
+    {
+        Log.d("Rockbox", (String)text);
+    }
     private void LOG(CharSequence text, Throwable tr)
     {
         Log.d("Rockbox", (String)text, tr);
@@ -82,7 +81,26 @@ public class RunForegroundManager
         mNM.cancel(R.string.notification);
         api.stopForeground();
     }
+    
+    private void updateNotificationText(String title, String line1, String line2)
+    {
+        RemoteViews views = mNotification.contentView;
+        String ticker;
+        views.setTextViewText(R.id.title, title);
+        views.setTextViewText(R.id.content_line1, line1);
+        views.setTextViewText(R.id.content_line2, line2);
+        if (line1 != null && line1 != "")
+            ticker = title + " - " + line1;
+        else
+            ticker = title;
+        mNotification.tickerText = ticker;
+    }
 
+    public void setNotificationText(String title, String line1, String line2)
+    {
+        updateNotificationText(title, line1, line2);
+        mNM.notify(R.string.notification, mNotification);
+    }
 
     private interface IRunForeground 
     {
diff --git a/android/src/org/rockbox/RockboxService.java b/android/src/org/rockbox/RockboxService.java
index 0737bf8..021fcc9 100644
--- a/android/src/org/rockbox/RockboxService.java
+++ b/android/src/org/rockbox/RockboxService.java
@@ -117,10 +117,13 @@ public class RockboxService extends Service
         
         /* Display a notification about us starting.  
          * We put an icon in the status bar. */
-        try {
-            fg_runner = new RunForegroundManager(this);
-        } catch (Exception e) {
-            e.printStackTrace();
+        if (fg_runner == null)
+        {
+            try {
+                fg_runner = new RunForegroundManager(this);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
         }
     }
 
diff --git a/apps/SOURCES b/apps/SOURCES
index c3020ec..0d0daf8 100644
--- a/apps/SOURCES
+++ b/apps/SOURCES
@@ -91,6 +91,7 @@ gui/statusbar-skinned.c
 #endif
 #if (CONFIG_PLATFORM&PLATFORM_ANDROID)
 hosted/yesno.c
+hosted/notification.c
 #else
 gui/yesno.c
 #endif
diff --git a/apps/apps.make b/apps/apps.make
index 6afcd12..a430288 100644
--- a/apps/apps.make
+++ b/apps/apps.make
@@ -8,6 +8,9 @@
 #
 
 INCLUDES += -I$(APPSDIR) $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
+ifdef APP_TYPE
+	INCLUDES += -I$(APPSDIR)/hosted
+endif
 SRC += $(call preprocess, $(APPSDIR)/SOURCES)
 
 # apps/features.txt is a file that (is preprocessed and) lists named features
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index 7d633ad..717a58a 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -1189,6 +1189,8 @@ static void wps_state_init(void)
     /* add the WPS track event callbacks */
     add_event(PLAYBACK_EVENT_TRACK_CHANGE, false, track_changed_callback);
     add_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, false, nextid3available_callback);
+    extern void notification_init(void);
+    notification_init();
 }
 
 
diff --git a/apps/hosted/notification.c b/apps/hosted/notification.c
new file mode 100644
index 0000000..205c2a1
--- /dev/null
+++ b/apps/hosted/notification.c
@@ -0,0 +1,52 @@
+/***************************************************************************
+ *             __________               __   ___.
+ *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
+ *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
+ *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
+ *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
+ *                     \/            \/     \/    \/            \/
+ * $Id$
+ *
+ * Copyright (C) 2010 Thomas Martitz
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#include "notification.h"
+#include "appevents.h"
+#include "string-extra.h"
+#include "metadata.h"
+#include "misc.h"
+
+/*
+ * notify about track change, and show track info */
+static void track_changed_callback(void *param)
+{
+    struct mp3entry* id3 = (struct mp3entry*)param;
+    if (id3)
+    {
+        char buf[100];
+        const char * headline = id3->title;
+        if (!headline)
+        {   /* pass the filename if id3 info isn't available */
+            headline =
+                strip_extension(buf, sizeof(buf), strrchr(id3->path,'/') + 1);
+        }
+        const char * content1 = id3->artist;
+        const char * content2 = id3->album;
+        notification_notify(headline, content1, content2);
+    }
+}
+
+void notification_init(void)
+{
+    notification_init_target();
+    add_event(PLAYBACK_EVENT_TRACK_CHANGE, false, track_changed_callback);
+}
diff --git a/apps/hosted/notification.h b/apps/hosted/notification.h
new file mode 100644
index 0000000..af5e054
--- /dev/null
+++ b/apps/hosted/notification.h
@@ -0,0 +1,28 @@
+/***************************************************************************
+ *             __________               __   ___.
+ *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
+ *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
+ *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
+ *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
+ *                     \/            \/     \/    \/            \/
+ * $Id$
+ *
+ * Copyright (C) 2010 Thomas Martitz
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#ifndef __NOTIFICATION_H__
+#define __NOTIFICATION_H__
+
+#include "notification-target.h"
+void notification_init(void);
+
+#endif
diff --git a/apps/main.c b/apps/main.c
index 950168d..00b2830 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -76,6 +76,9 @@
 #include "skin_engine/skin_engine.h"
 #include "statusbar-skinned.h"
 #include "bootchart.h"
+#if defined(APPLICATION) && (CONFIG_PLATFORM & PLATFORM_ANDROID)
+#include "notification.h"
+#endif
 
 #ifdef IPOD_ACCESSORY_PROTOCOL
 #include "iap.h"
@@ -333,11 +336,11 @@ static void init_tagcache(void)
 
 static void init(void)
 {
+    system_init();
+    kernel_init();
 #ifdef APPLICATION
     paths_init();
 #endif
-    system_init();
-    kernel_init();
     buffer_init();
     enable_irq();
     lcd_init();
@@ -351,6 +354,9 @@ static void init(void)
 #if (CONFIG_PLATFORM & PLATFORM_SDL)
     sim_tasks_init();
 #endif
+#if (CONFIG_PLATFORM & PLATFORM_ANDROID)
+    notification_init();
+#endif
     lang_init(core_language_builtin, language_strings, 
               LANG_LAST_INDEX_IN_ARRAY);
 #ifdef DEBUG
diff --git a/firmware/SOURCES b/firmware/SOURCES
index a2aaac1..6b3ceea 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -1717,6 +1717,7 @@ target/hosted/android/system-android.c
 target/hosted/android/telephony-android.c
 #ifdef APPLICATION
 target/hosted/android/app/button-application.c
+target/hosted/android/app/notification-application.c
 #endif
 drivers/audio/android.c
 thread.c
diff --git a/firmware/target/hosted/android/app/notification-application.c b/firmware/target/hosted/android/app/notification-application.c
new file mode 100644
index 0000000..9eb52ac
--- /dev/null
+++ b/firmware/target/hosted/android/app/notification-application.c
@@ -0,0 +1,66 @@
+/***************************************************************************
+ *             __________               __   ___.
+ *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
+ *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
+ *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
+ *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
+ *                     \/            \/     \/    \/            \/
+ * $Id$
+ *
+ * Copyright (C) 2010 Thomas Martitz
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#include <jni.h>
+#include "notification-target.h"
+
+extern JNIEnv *env_ptr;
+extern jclass RockboxService_class;
+extern jobject RockboxService_instance;
+
+static jmethodID setNotificationText;
+static jobject NotificationManager_instance;
+static jstring _headline, _content1, _content2;
+
+
+bool notification_notify(const char *headline,
+                         const char *content1,
+                         const char *content2)
+{
+    JNIEnv e = *env_ptr;
+    /* passing NULL to DeleteLocalRef() is OK */
+    e->DeleteLocalRef(env_ptr, _headline);
+    e->DeleteLocalRef(env_ptr, _content1);
+    e->DeleteLocalRef(env_ptr, _content2);
+
+    _headline = e->NewStringUTF(env_ptr, headline);
+    _content1 = e->NewStringUTF(env_ptr, content1);
+    _content2 = e->NewStringUTF(env_ptr, content2);
+
+    e->CallVoidMethod(env_ptr, NotificationManager_instance,
+                      setNotificationText, _headline, _content1, _content2);
+    return true;
+}
+
+void notification_init_target(void)
+{
+    JNIEnv e = *env_ptr;
+    jfieldID nNM = e->GetFieldID(env_ptr, RockboxService_class,
+                    "fg_runner", "Lorg/rockbox/Helper/RunForegroundManager;");
+    NotificationManager_instance = e->GetObjectField(env_ptr,
+                                                RockboxService_instance, nNM);
+
+    jclass class = e->GetObjectClass(env_ptr, NotificationManager_instance);
+    setNotificationText = e->GetMethodID(env_ptr, class, "setNotificationText",
+                                         "(Ljava/lang/String;"
+                                          "Ljava/lang/String;"
+                                          "Ljava/lang/String;)V");
+}
diff --git a/firmware/target/hosted/android/app/notification-target.h b/firmware/target/hosted/android/app/notification-target.h
new file mode 100644
index 0000000..7c90da4
--- /dev/null
+++ b/firmware/target/hosted/android/app/notification-target.h
@@ -0,0 +1,31 @@
+/***************************************************************************
+ *             __________               __   ___.
+ *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
+ *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
+ *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
+ *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
+ *                     \/            \/     \/    \/            \/
+ * $Id$
+ *
+ * Copyright (C) 2010 Thomas Martitz
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+
+#ifndef __NOTIFICATION_TARGET_H__
+#define __NOTIFICATION_TARGET_H__
+#include <stdbool.h>
+
+void notification_init_target(void);
+bool notification_notify(const char *headline,
+                         const char *content1,
+                         const char *content2);
+#endif
