- Home /
Which "using directive" to use "Intent" for open url in android ?
I saw different topic about open url in web browser in foreground:
http://stackoverflow.com/questions/13492364/open-a-url-in-androids-web-browser-from-application?rq=1
I don't know how to use the instructions below under VS2010 :
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"));
startActivity(browserIntent);
Someone can tell me how to use it ?
Edit: If Intent is an android function, how can i use it with Unity and c# scripting ?
Edit II: Please help me, i am newbie in Android Developpement ! What is the procedure to use Android Function and callbacks like "Intent" ?
Answer by SubatomicHero · Jun 07, 2013 at 06:56 AM
To be able to use Intent, you need to include/import depending on your IDE the correct libraries.
For example in Java you need to add:
import android.content.Intent;
To the top of your page otherwise you cannot use the library.
Also have you downloaded/paid for the Android license within Unity? That should then open up all the libraries for use within Unity3D
Ok so if i understand well the libraries are automatically added to my IDE (VS2010) ?
Have i to use AndroidJavaClass, AndroidJavaObject, etc. ?
Are the libraries in the download of Android license ?
Yes i paid for the android license and i am able to export my project on Android platform
I also download android sdk for windows (android SD$$anonymous$$_r21.1-windows) and i am using 2.2 (froyo API) of android
I believe so but it's worth reading the android unity documentation or even contacting their customer support for more information.
Ok i think i begin to understand I saw there "import android.content.Intent;" in an Android Plugin for Unity http://gamedev.stackexchange.com/questions/25851/starting-a-java-activity-in-unity3d-android
Then i have to put it in my Unity Projects in Assets/Plugins/Android/
Finally i have to use AndroidJavaClass in order to exploit that package
Am I right ? Am i missing something ?
Anyway thank you SubatomicHero for your answer