0

I have made an android app that includes a game module, I have made game using unity. Now I want to get game score back into my android application when user finish the game. I am starting game using an implicit intent.

Here is how i am starting game. startNewActivity(GameClubMediaIntro.this,"com.flieskiller");

  public void startNewActivity(Context context, String packageName) {
        Intent intent = context.getPackageManager().getLaunchIntentForPackage(packageName);
        if (intent == null) {
            // Bring user to the market or let them choose an app?
            intent = new Intent(Intent.ACTION_VIEW);
            intent.setData(Uri.parse("market://details?id=" + packageName));
        }
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
    }

On game finished i need its score back into my android app. I have gone through this question, Read Android intent extra data on Unity app launch But it doesn't tell how to channel data back to app.

Community
  • 1
  • 1
Muhammad Usman
  • 200
  • 1
  • 14
  • How about you send your score to a server and your app fetches the score from the server. It would be much more maintainable. – Sourav Kanta Sep 01 '16 at 07:04
  • But it should not be recommendable. As there might be network issue. I want to avoid network overhead. Is there some file system available in unity to store score which would be accessible to my android app – Muhammad Usman Sep 01 '16 at 07:09
  • @SouravKanta I am resuming my app immediately after game closes. – Muhammad Usman Sep 01 '16 at 07:10

0 Answers0