Skip to main content

Posts

Showing posts with the label Intent

How to open any other App or website from your app?

Intent can be used to open urls or other apps from android app. To open URLs from app 1. In order to link to a url from your app, which means on clicking a button or on any other event the url opens in default browser in mobile, first add an  intent  component in LOGIC area of Sketchware project. 2. Next, on button click event, add following blocks: Intent setAction ACTION_VIEW, Intent setData  URL of website to be opened StartActivity Intent To open other apps in mobile from app 1. Other apps in mobile can be opened using the package name of those apps. If the app is not installed on mobile, then it will not open. Below is an example to open Snapseed photo editor app from a Sketchware app. 2. In order to open other apps directly on button click, add an  intent  component as shown above. 3. Next, on button click event, add following blocks: Intent setAction ACTION_VIEW, Intent setData  android-app://com.niksoftware.snapseed(package name of the app) StartAct...

Use of Intent to Mail, SMS, MMS and Call

In Sketchware, the uses of Intent activity are limited as it contains only three setAction options: ACTION_VIEW, ACTION_DIAL, and ACTION_CALL. Here I mention the logic/codes for a few uses of Intent. 1. Open a Url in mobile browser. Intent  (name)  setAction   ACTION_VIEW Intent  (name)  setData   http:// xyz.com StartActivity  (name) 2. Open mobile contacts. Intent  (name)  setAction   ACTION_VIEW Intent  (name)  setData   content://contacts/people/ StartActivity  (name) 3. Open mobile dialer. Intent  (name)  setAction   ACTION_DIAL Intent  (name)  setData   tel: 894...... StartActivity  (name) Also, Intent  (name)  setAction   ACTION_VIEW Intent  (name)  setData   tel: 894...... StartActivity  (name) 4. Call a number. Intent  (name)  setAction   ACTION_CALL Intent  (name)  setData   tel: 894...... StartActivity  ...

Create a Sketchware app which links to a website and exits on its own

1.  Download Sketchware , Open Sketchware App, go to my projects and start a new project. 2. Fill the App settings: package name, project name, App name, version, app icon. 3. Leave View area (main.xml) empty. 4. Go to Logic. Add a new  intent  component and name it 'web' (or anything else you want). 5. Now click on  onCreate  event. On activity onCreate add: Intent  web  setAction  ACTION_VIEW Intent  web  setData   http://yourweb.com (URL of website to be opened) StartActivity  web Finish Activity  6. Save and Run the App. 7. Your app will exit itself and open  http://yourweb.com  in default browser on your device. 8. End of tutorial.