Android Question Open some defaults apps?

MarianoDuk

Member
Licensed User
Hello, i have searched in previous posts, but you know, things changes over the years, and some examples dont work anymore on my phone, or are not exactly whay i need, so i want to ask you, and please apologize my english:

- can i open the default camera app? just open it, not need to save images. or make a slide viewer... just open it, as if you click you "Camera" icon... SOLVED
- can i open the inbox sms? the same... just open it, as if you clicked on "Mesages" app and show the inbox...
- can i open the "Photo" app? the same... just open it, to see the pictures, as if you clicked on "Photo" app and show the saved images SOLVED

Thank you.
 
Last edited:

JohnC

Expert
Licensed User
Longtime User
Yes, first search this forum with "open camera app intent" and see which results you get.

You can also google "intent to open camera app" and you will see sample intent code to do that. But you may need to do simple conversions of the found code to work with B4A by searching this forum for intent samples and see how they need to be slightly modified to work in B4A.
 
Last edited:
Upvote 0

JohnC

Expert
Licensed User
Longtime User
In addition to updating your post to "Solved" for each of the intents, it would be very helpful to others also looking for this solution if you could also post the intent that you found that works in B4A.
 
Upvote 0

MarianoDuk

Member
Licensed User
In addition to updating your post to "Solved" for each of the intents, it would be very helpful to others also looking for this solution if you could also post the intent that you found that works in B4A.

Yes, of course, but i really dont remember from where i downloaded that sample (i downloades a lot) ... All i can say is that it's a file named "CameraIntent" i founded in this forum, and it uses this: android.media.action.IMAGE_CAPTURE

Thanks.
 
Upvote 0

MarianoDuk

Member
Licensed User
I solved the "show photo's gallery" using another ZIP file, called "AS GALLERY" that i founded in this forum, thanks to the creator!
So, i only need toopen "message" android app.... Any idea?
Thanks.
 
Upvote 0

Andrew (Digitwell)

Well-Known Member
Licensed User
Try Google's messaging app. If not, then default to anything that can handle sms

B4X:
    Try
        mSms.Initialize(mSms.ACTION_VIEW, "sms:")
        mSms.SetPACKAGE("com.google.android.apps.messaging")
        StartActivity(mSms)
    Catch
        mSms.Initialize(mSms.ACTION_VIEW, "sms:")
        StartActivity(mSms)
    End Try
 
Upvote 0

MarianoDuk

Member
Licensed User
Try Google's messaging app. If not, then default to anything that can handle sms

B4X:
    Try
        mSms.Initialize(mSms.ACTION_VIEW, "sms:")
        mSms.SetPACKAGE("com.google.android.apps.messaging")
        StartActivity(mSms)
    Catch
        mSms.Initialize(mSms.ACTION_VIEW, "sms:")
        StartActivity(mSms)
    End Try

Thank you Andrew.

Your code works! Almost... It shows the "Iniciar Chat" screen (i dont know in english devices, maybe Start Chat? as if you want to write a new one) and i need to go to the previous screen, that shows the "inbox". In fact, with your code, if after screen shows, i press the left arrow (in top left corner) it takes me to the inbox. But i need to go diredtly to that screen.

Thanks.
 
Upvote 0
Top