Search code examples
androidgoogle-cloud-platformgoogle-translate

Is it possible to hide one android app inside another?


I want to use google translate offline lang.packs. But it has to be a diff. app with a diff. icon.

My app has to work completely offline. Google translate does work offline if the packs are on the phone. But the packs are not available as standalone or in API format! I do know from another answer that the lang packs and the neural model is a major value of the company. So they dont want to give it away for free to devs as API.

Training my own neural model with libs like TensorFlow is daunting task. I want to reuse existing libraries\apps


Solution

  • Based on Google Play Privacy Policy Hiding an App within another App Without User's Knowledge is Considered as a Malicious Behavior.

    The following are explicitly prohibited:

    • Viruses, trojan horses, malware, spyware or any other malicious software. Apps that link to or facilitate the distribution or installation of malicious software.

    • Apps or SDKs that download executable code, such as dex files or native code, from a source other than Google Play.

    • Apps that introduce or exploit security vulnerabilities.

    • Apps that steal a user’s authentication information (such as usernames or passwords) or that mimic other apps or websites to trick users into disclosing personal or authentication information.

    • Apps that install other apps on a device without the user’s prior consent.

    • Apps designed to secretly collect device usage, such as commercial spyware apps.

    Here are my Suggestions.

    Suggestion 1 : Recommended Way

    • Check Weather the Required Applications are Installed / Not in User Mobile

          try {                          
              context.getPackageManager().getApplicationInfo(packageName, 0);
              return true;  //Application Installed
          }
          catch (PackageManager.NameNotFoundException e) {
              return false; //Application Not Installed
          }
      
    • If not Redirect them to the PlayStore (Originally Answered Here)

       final String appPackageName = getPackageName(); // getPackageName()
       from Context or Activity object try {
           startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName))); } catch
       (android.content.ActivityNotFoundException anfe) {
           startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" +
       appPackageName))); }
      

    Suggestion 2 : If You wish to Distribute the Application offline(Not through PlayStore) Then

    • Append the Required Apk Files in Assets folder of the Main Application
    • Do the same Check Like in Suggestion 1. But Instead of Redirecting to PlayStore, Launch the Package Installer for the Apk in Assets Folder.

    I have done a Demo Project for this scenario . Please Check it for More Reference