I am developing an Answering Machine application.
Basically it has to automatically accept the call, give a voice message and start recording the call.
I have designed an application to automatically answer to calls and another application to record calls. Individually both the apps work fine. But after i merged them the application crashes.
I saw a an example here :Combine 2 android apps. I merged the apps same way but still the application crashes.
How can I properly merge my apps?
Try
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setClassName("com.example.package", "com.example.package.ActivityToStart");
startActivity(intent);
or
PackageManager pm = getPackageManager();
Intent intent = pm.getLaunchIntentForPackage("com.example.package");
startActivity(intent);
to invoke 2 apps. And retrieve files from their default save location.
Related
In fact, I want to be noticed when the program is downloaded without the user having to install their own apps (Install without show permissions activity).
Now I use the following code, and I want to change this code to answer my question.
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file),"application/vnd.android.package-archive");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
The following image is displayed after downloading the app from my server and i dont want to show
I am looking to start a specific application(Dictionary app) from my app. Using intents, how would I go about launching that specific app and use it to look up the word.
There are implicit intents and explicit intents, you want an explicit intent to get your desirable.
Here is how you can do it.
Intent intent = new Intent();
intent.setComponent(new ComponentName("com.example", "com.example.MyExampleActivity"));
startActivity(intent);
in the setComponent method your Dictionary app information should go in.
CommonsWare addition to this answer,
Using an explicit Intent to talk to a third-party app is rarely the right thing to do. This code will break if the activity is not exported, or requires permissions, or the developer refactors the code and changes the class name or package, etc.
If the author of the app is documenting that your recipe is the correct way to work with that activity on that app, then that is fine, as the developer presumably intends to support this use case.
As the HTC ONE M8 is certified for MirrorLink usage, it also has a customized car app, which comes with an activity that allows phone calls while driving.
Is there a way to start this activity from an external application? Is the only way to call this activity if the app or rather that activity has implemented the ACTION_CALL intent?
thanks
Is there a way to start this activity from an external application?
Yes, you can do that with an intent filter, hereĀ“s the information:
http://developer.android.com/training/basics/intents/filters.html
but if you only want to open the application, knowing the application package is enough with:
PackageManager pm = getPackageManager();
Intent intent = pm.getLaunchIntentForPackage("your.other.app");
startActivity(intent);
I am creating an application from which the user can call people. In this application I would like to give the option of using either the phone's dialer or other VOIP applications such as Skype or Lync (which incidentally are both Microsoft software). My only problem is that they don't seem to be registered to listen for android.intent.action.CALL (this gives me the phone), but only for android.intent.action.CALL_PRIVILEGED - via which I cannot reach the phone's dialer (I'm guessing that's the privileged part). I'm developing on a stock Nexus 4 btw.
Is there a pretty way that I can launch my intent and be given the option of both the dialer and also Skype/Lync?
Right now my calling the intent looks like this:
Uri numberUri = Uri.parse("tel:" + number);
final Intent intent = new Intent("android.intent.action.CALL_PRIVILEGED");
intent.setData(numberUri);
mContext.startActivity(intent);
Feel free exchange the contents of the intent for Intent.ACTION_CALL - I'm doing it all the time at the moment.
Sorry Dear this cannot be possible.
is it possible to call more packages in single project,without installing the other packages in emulator/phone,want single apk file..I Kept this code...but is possible when the package is available in emulator/phone..Please suggest me...if that package is not available in emulator/phone
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setComponent(new ComponentName(
"com.abc.def.packname",
"com.abc.def.packname.MyActivity"));
startActivity(intent);
To be able to use an Intent to launch any Activity, there must be an Activity available to Handle it. This applies for both direct intents that target one particular Activity, and more general intents which would result in a Chooser dialog, like the share intent.
So in short, yes, the package you are referencing must be installed as well, or else your app will crash. If you have access to the source code of the other project, you could combine them into one. If this isn't possible, you could request that the user installs the other app when your app starts.