Android Question Help App2App

astf

Member
Licensed User
Longtime User
I need to call other App(pagseguro), send a value($$), and get the response of transaction...


B4X:
    Dim in As Intent
    in.Initialize(in.ACTION_MAIN,"")

    in.SetComponent("br.com.uol.ps")
    'or ???
    in.SetComponent("br.com.uol.ps.app")

    in.PutExtra("FLAG_APP_PAYMENT_VALUE",10.00)
    StartActivity(in)

return "Complete action using" and show me a list of apps!!!
but the app i want isn't on that list
https://postimg.org/image/90wpjfvwn/


The code in java

B4X:
private boolean checkIfAppIsInstalled() {
    PackageManager pm = getPackageManager();
    boolean installed = false;

    try {
        pm.getPackageInfo(PAG_SEGURO_PACKAGE_NAME,PackageManager.GET_ACTIVITIES);
        installed = true;
    } catch (PackageManager.NameNotFoundException e) {
        installed = false;
    }

    return installed;
}


private static final String PAG_SEGURO_PACKAGE_NAME = "br.com.uol.ps";
private static final String PAG_SEGURO_CLASS_NAME = "br.com.uol.ps.app.MainActivity";
private static final String FLAG_APP_PAYMENT_VALUE = "FLAG_APP_PAYMENT_VALUE";
private static final int REQUEST_CODE = 123;
BigDecimal paymentValue = new BigDecimal(“10.99”);

    Intent it = new Intent(Intent.ACTION_MAIN);

    it.setClassName(PAG_SEGURO_PACKAGE_NAME, PAG_SEGURO_CLASS_NAME); // Intent que será chamada.
    it.putExtra(FLAG_APP_PAYMENT_VALUE, paymentValue); // Valor da venda.

    try {
        startActivityForResult(it, REQUEST_CODE); // Chama o aplicativo do PagSeguro.
    } catch (ActivityNotFoundException e) {
        Toast.makeText(getApplicationContext(), "Aplicativo PagSeguro não instalado", Toast.LENGTH_SHORT).show();
    }



private static final String FLAG_RESULT_ERROR_CODE = "FLAG_RESULT_ERROR_CODE";
private static final String FLAG_RESULT_ERROR_MESSAGE ="FLAG_RESULT_ERROR_MESSAGE";

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (resultCode == RESULT_CANCELED) {
        //TODO: Apresentar mensagem de erro ao usuário informando que a operação foi cancelada
    } else if (resultCode == RESULT_OK) {

        if (data.hasExtra(FLAG_RESULT_ERROR_MESSAGE)) {
            int errorCode = data.getIntExtra(FLAG_RESULT_ERROR_CODE, 0);
            String errorMessage = data.getStringExtra(FLAG_RESULT_ERROR_MESSAGE);
        } else {

            String transactionCode = data.getStringExtra(FLAG_TRANSACTION_CODE);
            String paymentMethod = data.getStringExtra(FLAG_PAYMENT_METHOD);
            String cardBrand = data.getStringExtra(FLAG_CARD_BRAND);
            String cardHolder = data.getStringExtra(FLAG_CARD_HOLDER);
            BigDecimal paymentAmount = (BigDecimal)
      
            data.getSerializableExtra(FLAG_PAYMENT_AMOUNT, 0);
            int installmentNumber = data.getIntExtra(FLAG_INSTALLMENT_NUMBER,0);
            BigDecimal installmentAmount = (BigDecimal)
            data.getSerializableExtra(FLAG_PAYMENT_INSTALLMENT, 0);

            Calendar time = (Calendar)
            data.getSerializableExtra(FLAG_PAYMENT_TIME);
        }
    }
}
 

astf

Member
Licensed User
Longtime User
Thx Erel....

now i cant pass values... always 0

B4X:
    ...
    ...
    ...
    Log(gValorArec) '22.91
    valor.Initialize(gValorArec)
    In.SetComponent("br.com.uol.ps/br.com.uol.ps.app.MainActivity")
    In.PutExtra("FLAG_APP_PAYMENT_VALUE",valor)
    In.PutExtra("REQUEST_CODE","123456798")
    StartActivityForResult(In)
 
Upvote 0

astf

Member
Licensed User
Longtime User
Yes valor is BigDecimal
B4X:
  Private gValorRec as Double ' valor de recebimento
  Private valor As BigDecimal ' valor a passar pagseguro

Nothing o logs!!


LOG

Timeline: Activity_launch_request time:111839973
requestSplashScreen
offline package br.com.uol.ps false
requestSplash, package:br.com.uol.ps, intent:Intent { act=android.intent.action.MAIN cmp=br.com.uol.ps/.app.MainActivity }, showing:false
packageName:br.com.uol.ps, showInterval:600000
isAppSplash intent:Intent { act=android.intent.action.MAIN cmp=br.com.uol.ps/.app.MainActivity } aInfo:ActivityInfo{3d28afb0 br.com.uol.ps.app.MainActivity} showType
Activity:ActivityInfo{3d28afb0 br.com.uol.ps.app.MainActivity}is not the default one
requestSplashScreen duration:1, package:br.com.uol.ps
onAMCreateActivity callback
START u0 {act=android.intent.action.MAIN cmp=br.com.uol.ps/.app.MainActivity} from uid 10169 on display 0
onAMPauseActivity callback
addAppToken: AppWindowToken{26bc2026 token=Token{5a93781 ActivityRecord{1866f768 u0 br.com.uol.ps/.app.MainActivity t1399}}} to stack=1 task=1399 at 2
CPU Rendering VSync enable = true
Adding window Window{2d7d9fac u0 Starting br.com.uol.ps} at 5 of 12 (after Window{19376784 u0 br.inf.mssistemas.posmobile/br.inf.mssistemas.posmobile.ficha})
** Activity (ficha) Pause, UserClosed = false **
Start proc 29831:br.com.uol.ps/u0a160 for activity br.com.uol.ps/.app.MainActivity
zw_AudioPolicyManager::isStateInCall: 0
unknown stream type 13
zw_AudioPolicyManager::isStateInCall: 0
unknown stream type 13
unknown stream type 13
unknown stream type 13
unknown stream type 13
unknown stream type 13
unknown stream type 13
unknown stream type 13
unknown stream type 13
unknown stream type 13
unknown stream type 13
unknown stream type 13
unknown stream type 13
zw_AudioPolicyManager::isStateInCall: 0
zw_AudioPolicyManager::isStateInCall: 0
zw_AudioPolicyManager::isStateInCall: 0
zw_AudioPolicyManager::isStateInCall: 0
zw_AudioPolicyManager::isStateInCall: 0
zw_AudioPolicyManager::isStateInCall: 0
zw_AudioPolicyManager::isStateInCall: 0
zw_AudioPolicyManager::isStateInCall: 0
zw_AudioPolicyManager::isStateInCall: 0
zw_AudioPolicyManager::isStateInCall: 0
zw_AudioPolicyManager::isStateInCall: 0
unknown stream type 13
unknown stream type 13
zw_AudioPolicyManager::isStateInCall: 0
zw_AudioPolicyManager::isStateInCall: 0
unknown stream type 13
unknown stream type 13
onAMProcStart callback
Explicit concurrent mark sweep GC freed 707(30KB) AllocSpace objects, 0(0B) LOS objects, 40% free, 8MB/13MB, paused 407us total 19.960ms
TidaProvider()
Explicit concurrent mark sweep GC freed 7(240B) AllocSpace objects, 0(0B) LOS objects, 39% free, 8MB/13MB, paused 500us total 22.086ms
onAMRestartActivity callback
set foreground process size 1 pid:29831pacakgeName:br.com.uol.ps
{WhetstonePackageInfo#PacakgeName:br.com.uol.ps uiMemoryThresold:0 nonUiMemoryThresold:0 Flag:1073745984,0x40001040 [,TRIMHEAPS,FLAG_DEAL_SCHEDULE] Type:64[,AUTO_START] }not support ZRAM
Timeline: App_transition_ready time:111840172
Explicit concurrent mark sweep GC freed 5(160B) AllocSpace objects, 0(0B) LOS objects, 39% free, 8MB/13MB, paused 379us total 20.254ms
com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
App measurement is starting up, version: 9256
To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
FirebaseApp initialization successful
FPS: 23
Initializing Crashlytics 2.3.10.127
Google Analytics 9.2.56 is starting up. To enable debug logging on a device run:
adb shell setprop log.tag.GAv4 DEBUG
adb logcat -s GAv4
AnalyticsReceiver is not registered or is disabled. Register the receiver for reliable dispatching on non-Google Play devices. See http://goo.gl/8Rd3yj for instructions.
CampaignTrackingReceiver is not registered, not exported or is disabled. Installation campaign tracking is not possible. See http://goo.gl/8Rd3yj for instructions.
AnalyticsService not registered in the app manifest. Hits might not be delivered reliably. See http://goo.gl/8Rd3yj for instructions.
Timeline: App_transition_stopped time:111840530
LIFECYCLE RESUME
CPU Rendering VSync enable = true
Use EGL_SWAP_BEHAVIOR_PRESERVED: true
Validating map...
Adding window Window{2a24233f u0 br.com.uol.ps/br.com.uol.ps.app.MainActivity} at 5 of 13 (before Window{2d7d9fac u0 Starting br.com.uol.ps})
clearCachedDrawables.
firewall pkgName:br.com.uol.ps, result:0x0
setAppName(), name=[system_server], active=[0]
DiracSound_command() start, cmdCode=23
DiracSound_Command EFFECT_CMD_SET_APP_NAME: stream=1, name=-system_server
<qeglDrvAPI_eglInitialize:379>: EGL 1.4 QUALCOMM build: Nondeterministic_AU_msm8916_32_LA.BR.1.2.4_RB1__release_AU (Ic8ede1fb34)
OpenGL ES Shader Compiler Version: E031.25.03.04
Build Date: 12/10/15 Thu
Local Branch: mybranch17178083
Remote Branch: quic/LA.BR.1.2.4_rb1.30
Local Patches: NONE
Reconstruct Branch: NOTHING
Initialized EGL, version 1.4
Enabling debug mode 0
cancel()
start(3000)
Displayed br.com.uol.ps/.app.MainActivity: +1s22ms
Timeline: Activity_windows_visible id: ActivityRecord{1866f768 u0 br.com.uol.ps/.app.MainActivity t1399} time:111841088
showStatusIcon on inactive InputConnection
Timeline: Activity_idle id: android.os.BinderProxy@333882e7 time:111841302
activityIdle:ActivityInfo{1fa9e29 br.com.uol.ps.app.MainActivity} mPendingSwitchingActivityInfo:null
FPS: 36
cancel()
reset:86400000
cancel()
start(0)
#startService for null, APP_NAMES.
[ColorAdjust] gammamode=2, cemode=10
[ColorAdjust] temp_gammavalue=2, temp_cevalue=10
[ColorAdjust] Don't setGamma!
[ColorAdjust] Don't setCe!
out_standby: enter: stream (0xb8ab7778) usecase(0: deep-buffer-playback)
[ColorAdjust] Set temp_prefer temp_ce!
FPS: 2
do trim { PackageName :com.miui.securitycenter Pid: 29540 Uid: 1000 Start by: activity Score:50 Old score:50 state:0 mBackgroundTimeInMillis:1478170345120 WakelockCount:0 wakelogsize:0 ActivityDestroied:false Activity size: 0 PackageInfo:{WhetstonePackageInfo#PacakgeName:com.miui.securitycenter uiMemoryThresold:22 nonUiMemoryThresold:20 Flag:-2147479740,0x80000f44 [,DestoryActivity,TRIMHEAPS,TRIM_OPENGL,SOFT_RESET,APP_SYSTEM,TRIMPROCESS_BY_ACTIVITY] Type:0[] } tasknum:1397}
do trim { PackageName :com.miui.securitycenter Pid: 4723 Uid: 1000 Start by: unknown Score:50 Old score:50 state:0 mBackgroundTimeInMillis:1478170345120 WakelockCount:0 wakelogsize:0 ActivityDestroied:false Activity size: 0 PackageInfo:{WhetstonePackageInfo#PacakgeName:com.miui.securitycenter uiMemoryThresold:22 nonUiMemoryThresold:20 Flag:-2147479740,0x80000f44 [,DestoryActivity,TRIMHEAPS,TRIM_OPENGL,SOFT_RESET,APP_SYSTEM,TRIMPROCESS_BY_ACTIVITY] Type:0[] } tasknum:-1}
do trim { PackageName :com.miui.securitycenter Pid: 4852 Uid: 1000 Start by: unknown Score:50 Old score:50 state:0 mBackgroundTimeInMillis:1478170345120 WakelockCount:0 wakelogsize:0 ActivityDestroied:false Activity size: 0 PackageInfo:{WhetstonePackageInfo#PacakgeName:com.miui.securitycenter uiMemoryThresold:22 nonUiMemoryThresold:20 Flag:-2147479740,0x80000f44 [,DestoryActivity,TRIMHEAPS,TRIM_OPENGL,SOFT_RESET,APP_SYSTEM,TRIMPROCESS_BY_ACTIVITY] Type:0[] } tasknum:-1}
NL MSG, len[4055], NL type[0x1C] WNI type[0x5900] len[48911]
NL MSG, PID: 304
CM callback handler got msg 524290
updateNetworkScore for NetworkAgentInfo [WIFI () - 139] to 60
CM callback handler got msg 524290
rematching NetworkAgentInfo [WIFI () - 139]
Network NetworkAgentInfo [WIFI () - 139] was already satisfying request 1. No change.
notifyType AVAILABLE for NetworkAgentInfo [WIFI () - 139]
onAvailable 139 : [ Transports: WIFI Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN LinkUpBandwidth>=1048576Kbps LinkDnBandwidth>=1048576Kbps]
CM callback handler got msg 524290
CM callback handler got msg 524290
slot=-10;action=android.net.wifi.RSSI_CHANGED
updateNetworkName chosenNetType=3;mNetworkName[0]=Vivo 3G
updateNetworkName chosenNetType=16;mNetworkName[1]=TIM
audio_extn_sound_trigger_update_stream_status: uc_id 0 of type 0 for Event 2, with Raise=1
handle_audio_concurrency: Enter, event type = 2
platform_stdev_check_and_update_concurrency: concurrency active 0, tx 0, rx 0, concurrency session_allowed 1
hw_info_append_hw_type : device_name = speaker
audio_extn_sound_trigger_update_device_status: device 0x2 of type 0 for Event 0, with Raise=0
DiracSound_command() start, cmdCode=22
DiracSound_Command EFFECT_CMD_SET_AUDIO_STANDBY, current mode = 0
NL MSG, len[048], NL type[0x11] WNI type[0x5050] len[028]
NL MSG, PID: 304
memDiff : 17, timeDiff : 1478170421940
cycle_memory
screen on : true, enable : true
notifyNotification
updateNotification pkg=com.miui.securitycenter;id=20004
FPS: 5
FPS: 3
updateNetworkScore for NetworkAgentInfo [WIFI () - 139] to 56
rematching NetworkAgentInfo [WIFI () - 139]
Network NetworkAgentInfo [WIFI () - 139] was already satisfying request 1. No change.
notifyType AVAILABLE for NetworkAgentInfo [WIFI () - 139]
CM callback handler got msg 524290
CM callback handler got msg 524290
onAvailable 139 : [ Transports: WIFI Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN LinkUpBandwidth>=1048576Kbps LinkDnBandwidth>=1048576Kbps]
slot=-10;action=android.net.wifi.RSSI_CHANGED
CM callback handler got msg 524290
CM callback handler got msg 524290
updateNetworkName chosenNetType=3;mNetworkName[0]=Vivo 3G
updateNetworkName chosenNetType=16;mNetworkName[1]=TIM
firewall pkgName:com.google.android.gms, result:0x0
NL MSG, len[4089], NL type[0x1C] WNI type[0x5900] len[57615]
NL MSG, PID: 304
 
Last edited:
Upvote 0
Top