0

There are 2 independent apps that are inter-linked. Hence, info details that have been captured in the secondary can be displayed and called into the first, primary app. Therefore, the functionality will be; there is a link in the first app that will open the secondary app which will capture and store the details. After which when the primary app starts, it will retrieve and display the same info. However, there is a constraint, and the constraint is that the calling of the details into the primary app is done within the static environment; no network or database. Are there any method codes that allow one app to call and display the details captured in a secondary app?

Here is the code snippets from the secondary app that captures the info-details:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (resultCode == Activity.RESULT_OK ) {
        if (requestCode == REQUEST_CODE_RECOGNIZE) {
            showResult(data.getStringExtra(OpenApi.EXTRA_KEY_VCF), data.getStringExtra(OpenApi.EXTRA_KEY_IMAGE));
        }
    } else {
        int errorCode = data.getIntExtra(openApi.ERROR_CODE, 200);
        String errorMessage = data.getStringExtra(openApi.ERROR_MESSAGE);
        Log.d(TAG, "error: " + errorCode + ","+errorMessage);
        Toast.makeText(this, "Scanning cancelled/failed. ErrorCode: " + errorCode + " ErrorMsg:" + errorMessage, Toast.LENGTH_LONG).show();
    }
    super.onActivityResult(requestCode, resultCode, data);
}
Ernest Lee
  • 95
  • 1
  • 17
  • so you want to open secondary app, capture some info, store it (somehow) then when the primary app starts, it should try to get the same info from the secondary app? is that right? – Yazan Sep 28 '14 at 09:29
  • @Yazan There is a link in the first app that will open the secondary app which will capture and store the details. After which when the primary app starts, it will retrieve and display the same info. Yes – Ernest Lee Sep 28 '14 at 10:46
  • have a look here, you can use ContentProvider, or the other way, http://stackoverflow.com/questions/18966016/how-to-pass-data-both-ways-between-different-android-applications – Yazan Sep 28 '14 at 11:23
  • @Yazan but those methods proposed, can they be used for static environment? – Ernest Lee Sep 28 '14 at 11:33
  • what do you mean static env? – Yazan Sep 28 '14 at 11:41
  • Static environment as in no database and no network included. – Ernest Lee Sep 28 '14 at 13:17
  • did you check the link?, one way can get data without storing it on DB, and even ContentProvider can work with files – Yazan Sep 28 '14 at 14:07
  • @Yazan I have read the content for Content provider and it seems that it is generally used to offer complex data and files to other application. Are there any simpler methods? I would like to use how is SHaredPreferences applicable? – Ernest Lee Sep 29 '14 at 04:13
  • did you see the other sol. in the same post, where you got result from `getIntent()` at `onResume()` of primary app, however using a shared pref will make the data public, WORLD_READABLE, check this http://stackoverflow.com/questions/6030321/android-retrieving-shared-preferences-of-other-application – Yazan Sep 29 '14 at 07:10

0 Answers0