dependencies - How to make an Android app that depends on another app? -
if create app depends on app or apps (eg: facebook , twitter apps), yet not installed, there method of checking dependencies , installing them @ same time own app?
i did in application requires zxing scanner app installed. want inside onclick or ontouch:
try{ intent intent = new intent("com.google.zxing.client.android.scan"); intent.setpackage("com.google.zxing.client.android"); startactivityforresult(intent, 0); } catch (exception e) { createalert("barcode scanner not installed!", "this application uses " + "the open source barcode scanner zxing team, need install " + "this before can use software!", true); }
which calls
public void createalert(string title, string message, boolean button) { // http://androidideasblog.blogspot.com/2010/02/how-to-add-messagebox-in-android.html alertdialog alertdialog; alertdialog = new alertdialog.builder(this).create(); alertdialog.settitle(title); alertdialog.setmessage(message); if ((button == true)) { alertdialog.setbutton("download now", new dialoginterface.onclicklistener() { public void onclick(dialoginterface arg0, int arg1) { intent browserintent = new intent( intent.action_view, uri.parse("market://search?q=pname:com.google.zxing.client.android")); startactivity(browserintent); } }); } alertdialog.show(); }
then after sorting out code out realise asked installed @ same time app. not sure if should post code, may helpful
Comments
Post a Comment