2014-09-23 5 views
0

Согласно моей концепции приложения, мы не отправляем приложение в игровой магазин.установка приложения для Android от панели уведомлений

Всякий раз, когда пользователь запускает приложение, он проверяет последнее обновление через веб-службу. Если на сервере имеется последний apk, он будет загружен на конкретный путь в SD-карте. Процесс загрузки показан на панели уведомлений. Вот моя проблема.

After download is completed, the notification is shown in Notification bar as "App is completed downloading" with app icon. Now when the user touches the my apps notification i want it to be either installed or need to open the sd card path. How to implement this process 
+0

возможный дубликат [установить приложение программно на Android] (http://stackoverflow.com/questions/4604239/install-application-programmatically-on-android) –

ответ

1

Попробуйте это:

 Intent install_intent = new Intent(Intent.ACTION_VIEW); 
    install_intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory().getPath() + "/myapp.apk")),"application/vnd.android.package-archive"); 
    PendingIntent pending = PendingIntent.getActivity(YourAcrtivity.this,0, install_intent, 0); 
    notification.setContentIntent(pending); 
+0

где мне нужно выставить код выше !? –

+0

@SivaK Когда ваша загрузка завершена. Как вы загрузили файл? –

+0

s я получил его, спасибо .... –

Смежные вопросы