Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

338
Visualizações
Is it possible to open a game on the phone, for example, or enter the gallery while in my application?

I recently started programming, and I don’t have enough experience yet - so I ask you to help ...

I use Unity 2020, and the task arose to open games that are on the phone, for example, a gallery and other applications that are on the phone (not to open a link on the Internet, but an application on the phone), I have a code that makes it possible to control, for example, a browser located in the scene, while all this happens in my application, but I still wanted to know if this is possible, only not with the pages on the Internet, but with the applications themselves on the smartphone ... Thanks in advance!

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

ok, so for launch camera app you can use only C#:

 static int REQUEST_IMAGE_CAPTURE = 1;

 public void StartPlugin()
    {
      
        
        AndroidJavaClass IntentClass = new AndroidJavaClass("android.content.Intent");
        AndroidJavaObject IntentObject = new AndroidJavaObject("android.content.Intent");

        AndroidJavaObject MSObject = new AndroidJavaObject("android.provider.MediaStore");

        IntentObject.Call<AndroidJavaObject>("setAction", MSObject.GetStatic<string>("ACTION_IMAGE_CAPTURE"));

        AndroidJavaClass unity = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
        AndroidJavaObject currentActivity = unity.GetStatic<AndroidJavaObject>("currentActivity");
        currentActivity.Call("startActivityForResult", IntentObject, REQUEST_IMAGE_CAPTURE);

    }

and for launch app like viber, youtube you can use this code:

 private string package = "com.viber.voip";

 public void Launch()
    {
   
                    AndroidJavaClass activityClass;
                    AndroidJavaObject activity, packageManager;
                    AndroidJavaObject launch;



                    activityClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
                    activity = activityClass.GetStatic<AndroidJavaObject>("currentActivity");
                    packageManager = activity.Call<AndroidJavaObject>("getPackageManager");
                    launch = packageManager.Call<AndroidJavaObject>("getLaunchIntentForPackage", package);
                    activity.Call("startActivity", launch);
                
                 
    }

the package variable it is application id have a nice day!!! =)

over 4 years ago · Santiago Trujillo Relatório

0

For some applications (such as YouTube, Facebook) you can use

Application.OpenURL("http://unity3d.com/");

but this only works if you know the app link, for social media you can try the links until you find one that opens the app.

I haven't tried to do this with other apps, but if you can get the URL of the app (it's not too hard), you should be able to do it.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda