Question

I'm developing an app with the App Inventor for Android.

I want the open the native phone app of my android phone by clicking on a button. I try does do something similar like in this tutorial where Google Maps is opened by clicking on a list item.

For that i need the following information:

Action: android.intent.action.DIAL

ActivityPackage: ???

ActivityClass: ???

I guess the package is com.android.phone. But I also need the ActivityClass. I tried to google it but couldn't find anything about it.

EDIT: Turns out that the App Inventor provides a way to make a direct phone call (see screenshot).

enter image description here

Was it helpful?

Solution

in App Inventor you can use the Phone Call component to dial the phone and make a call

PhoneCall is a non-visible component that makes a phone call to the number specified in the PhoneNumber property, which can be set either in the Designer or Blocks Editor. You can use the MakePhoneCall method to make a phone call programatically from your app.

To directly specify the phone number, set the PhoneNumber property to a Text with the specified digits (for example, "6505551212"). The number can be formatted with hyphens, periods, and parentheses; they are ignored. You can't include spaces in the number.

In case you try do do something else, these Activity Starter links could help:

OTHER TIPS

try this for reading logs-

 try {
          Process process = Runtime.getRuntime().exec("logcat -d");
          BufferedReader bufferedReader = new BufferedReader(
          new InputStreamReader(process.getInputStream()));

          StringBuilder log=new StringBuilder();
          String line = "";
          while ((line = bufferedReader.readLine()) != null) {
            log.append(line);
          }
          TextView tv = (TextView)findViewById(R.id.textView1);
          tv.setText(log.toString());
        } catch (IOException e) {
        }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top