UT programming intents and system/app calls?
-
does UT provide a "intent" call basically allowing me to call funtions from another application basically android does it like this:
Intent it = new Intent("com.android.test2.Main2method"); context.sendBroadcast(it)
then:
public class ActionReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if ("com.android.test2.Main2method".equalsIgnoreCase(intent.getAction())) { Main2method(); } } }
and then:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); receiver = new ActionReceiver(); IntentFilter filter = new IntentFilter(); filter.addAction("com.android.test2.Main2method"); registerReceiver(receiver, filter); }
how does UT handle this? and any security measures i should be aware of?
-
@developerbayman
Applications are sandboxed in UT, so it cannot be achieved.
But there are exceptions to share data apps can call on the "Content Hub".Here is the doc about how to use it: https://docs.ubports.com/en/latest/appdev/guides/contenthub.html
-
@applee thank you very much
-
No idea about intents but I guess its equivalent would be content hub and URI handling. They're far from being robust but that's all we have now