Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1498] Open an app titanium from other app titanium

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2014-03-10T05:40:49.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid, ios
ReporterMarian Bresol
AssigneeRitu Agrawal
Created2014-02-27T17:03:11.000+0000
Updated2016-03-08T07:37:57.000+0000

Description

I'm programing an app in Titanium to Android and iOS. I have five app distinct but all use the same database. I need open an app from other app, similar at main menu, but I can't open the app. I can open tools tablet basic by example: email, bluetooth. But I can't open my app. The next code, it is called with an {noformat}addEventListener{noformat} in a buttom:
var intent = Ti.Android.createIntent({
				action : Ti.Android.ACTION_MAIN
			});
	Ti.Android.currentActivity.startActivity(intent);
			 
In my tiapp.xml or AndroidManifest I have:
	<activities>
			<intent-filter>

				<action android:name="android.intent.action.MAIN"/>
				<category android:name="android.intent.category.DEFAULT"/>

			</intent-filter>

		</activities>
		<activity android:configChanges="keyboardHidden|orientation|screenSize" android:label="Sdfm-Graf" android:name=".SdfmGrafActivity" android:theme="@style/Theme.Titanium">
			<intent-filter>
				<action android:name="android.intent.action.MAIN"/>
				<category android:name="android.intent.category.LAUNCHER"/>
			</intent-filter>
		</activity>
How call I my app in other app made by me? What changes I need do to work correctly? The same app should work in android and iOS. Please I need help!

Comments

  1. Ritu Agrawal 2014-02-27

    This question is more suited for the Q&A forum. I would suggest you to post your question there. Here is the Q&A link http://developer.appcelerator.com/questions/most-recent I found a similar topic of discussion there that might answer your question: https://developer.appcelerator.com/question/122245/can-i-call-anohter-appliction-or-app-in-titanium-app
  2. Marian Bresol 2014-02-28

    I was checking your recomendations but my problem it is different. Because I don't need open a app like what'sApp, I need open a app made for me. But I don't know how call my app into other app titanium. In one recomedation is writing that I can do this {noformat}Ti.Platform.openURL('whatsapp://');{noformat} but the event does not nothing.
  3. Ritu Agrawal 2014-03-03

    Here are a couple of resources that would help you to get started on this topic: http://fokkezb.nl/2013/08/26/url-schemes-for-ios-and-android-1/ https://speakerdeck.com/jasonkneen/titanium-and-url-schemes Let us know if you have any follow up question.
  4. Marian Bresol 2014-03-07

    I RESOLVED the problem. The solution was: It is a event in a button like this:
       buttonOpenApp.addEventListener('click', function() {
       		if (isAndroid) {
       
       			var intent = Ti.Android.createIntent({
       				packageName : ("com.package.MyApp"),//This is the complete package the app.
       				className : ("com.package.MyApp.MyAppActivity")//This is the name the activity, you need put the complete package.
       			});
       			var activity = Ti.Android.currentActivity.startActivity(intent);
       		} 
       	});
       
    I needed change the AndroidManifest in other directory for that the app see the changes the file. My AndroidManifest is equal that this:
     
       <manifest android:versionCode="1" android:versionName="1" package="com.package.MyApp" xmlns:android="http://schemas.android.com/apk/res/android">
       	<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="11"/>
       	<!-- TI_MANIFEST -->
       	<application android:debuggable="false" android:hardwareAccelerated="true" android:icon="@drawable/appicon" android:label="MyApp" android:name="MyAppApplication" android:theme="@android:style/Theme.Holo.Light">
       		<!-- TI_APPLICATION -->
       		<activity android:configChanges="keyboardHidden|orientation|screenSize" android:label="MyApp" android:name=".MyAppActivity" android:theme="@style/Theme.Titanium">
       			<intent-filter>
       				<action android:name="android.intent.action.MAIN"/>
       				<category android:name="android.intent.category.LAUNCHER"/>
       			</intent-filter>
       		</activity>
       </application>
       </manifest> 
       
    I hope this can help you.
  5. Ritu Agrawal 2014-03-10

    I am glad that you are able to open an application from another application now.

JSON Source