Upload
marcos-placona
View
339
Download
4
Embed Size (px)
Citation preview
Contextual Communications – Why should you Care?
<Say>Hello MobileTrends!</Say>
@[email protected] Evangelist @ Twilio
intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + "1234567890"));if (ActivityCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) { startActivity(intent);}
<uses-permission android:name="android.permission.CALL_PHONE" />
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); builder.setMessage("Calling...") .setCancelable(false) .setPositiveButton("Hang-up", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { phone.disconnect(); } });AlertDialog alert = builder.create();alert.show();phone.connect("+1234567890");
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); builder.setMessage("Calling...") .setCancelable(false) .setPositiveButton("Hang-up", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { phone.disconnect(); } });AlertDialog alert = builder.create();alert.show();phone.connect("+1234567890");
try { getApplicationContext().getPackageManager().getPackageInfo("com.facebook.katana", 0); startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/<id_here>")));} catch (PackageManager.NameNotFoundException e) { e.printStackTrace();}
try { getApplicationContext().getPackageManager().getPackageInfo("com.facebook.katana", 0); startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("fb://page/<id_here>")));} catch (PackageManager.NameNotFoundException e) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/<user_name_here>")));}
+48 732 483 676
How did I do?
@marcos_placona
github.com/[email protected] Evangelist @ Twilio
Text 1-10