• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
UBports Robot Logo UBports Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

UT programming intents and system/app calls?

Scheduled Pinned Locked Moved App Development
4 Posts 3 Posters 331 Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      developerbayman
      last edited by 29 Jan 2023, 23:00

      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?

      A 1 Reply Last reply 30 Jan 2023, 21:59 Reply Quote 0
      • A Offline
        AppLee @developerbayman
        last edited by 30 Jan 2023, 21:59

        @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

        D 1 Reply Last reply 30 Jan 2023, 22:52 Reply Quote 0
        • D Offline
          developerbayman @AppLee
          last edited by 30 Jan 2023, 22:52

          @applee thank you very much

          1 Reply Last reply Reply Quote 0
          • K Offline
            kugiigi
            last edited by 31 Jan 2023, 00:28

            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 😄

            1 Reply Last reply Reply Quote 2
            1 out of 4
            • First post
              1/4
              Last post