Navigation

    UBports Robot Logo

    UBports Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    UT programming intents and system/app calls?

    App Development
    3
    4
    169
    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.
    • developerbayman
      developerbayman last edited by

      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?

      AppLee 1 Reply Last reply Reply Quote 0
      • AppLee
        AppLee @developerbayman last edited by

        @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

        developerbayman 1 Reply Last reply Reply Quote 0
        • developerbayman
          developerbayman @AppLee last edited by

          @applee thank you very much

          1 Reply Last reply Reply Quote 0
          • K
            kugiigi last edited by

            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
            • First post
              Last post