Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View cketti's full-sized avatar

cketti cketti

View GitHub Profile
@cketti
cketti / keybase.md
Created April 2, 2014 14:35
Keybase proof

Keybase proof

I hereby claim:

  • I am cketti on github.
  • I am cketti (https://keybase.io/cketti) on keybase.
  • I have a public key whose fingerprint is E9B8 B841 2592 2037 5BAE 6E41 EE2F EF3A 7DA8 E289

To claim this, I am signing this object:

@cketti
cketti / Libraries.md
Last active August 29, 2015 14:16
Android Stammtisch Library/Developer Tools Lightning Talks (2015-02-25)
@cketti
cketti / SimpleEmailIntent.java
Last active January 7, 2016 07:50
Simple ACTION_SENDTO Intent creation
Intent emailIntent = new Intent(Intent.ACTION_SENDTO);
emailIntent.setData(Uri.parse("mailto:developer@example.com"));
@cketti
cketti / EmailIntent.java
Created January 7, 2016 07:50
Create and launch ACTION_SENDTO Intent
String mailto = "mailto:bob@example.org" +
"?cc=" + "alice@example.com" +
"&subject=" + Uri.encode(subject) +
"&body=" + Uri.encode(bodyText);
Intent emailIntent = new Intent(Intent.ACTION_SENDTO);
emailIntent.setData(Uri.parse(mailto));
try {
startActivity(emailIntent);
@cketti
cketti / BuildWithEmailIntentBuilder.java
Created January 7, 2016 07:53
Build ACTION_SENDTO Intent using EmailIntentBuilder
Intent emailIntent = EmailIntentBuilder.from(context)
.to("developer@example.org")
.subject("Feedback for MyAwesomeApp")
.build();
@cketti
cketti / LaunchWithEmailIntentBuilder.java
Created January 7, 2016 07:54
Build and launch ACTION_SENDTO Intent using EmailIntentBuilder
boolean success = EmailIntentBuilder.from(activity)
.to("support@example.org")
.cc("developer@example.org")
.subject("Error report")
.body(buildErrorReport())
.start();
@cketti
cketti / ShareWithCopyToClipboardAction.java
Created June 13, 2016 00:57
Share text, but add an additional entry to the Chooser dialog
String url = "https://example.org/cool-link";
// Create Share Intent
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT, "hey kids check out this cool link\n" + url);
// Create "Copy Link To Clipboard" Intent
Intent clipboardIntent = new Intent(context, CopyToClipboardActivity.class);
@cketti
cketti / CopyToClipboardActivity.java
Last active June 13, 2016 01:12
Activity that copies the URL from the Intent to the clipboard
public class CopyToClipboardActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Uri uri = getIntent().getData();
if (uri != null) {
copyTextToClipboard(uri.toString());
Toast.makeText(this, "Link copied to clipboard", Toast.LENGTH_SHORT).show();
@cketti
cketti / AndroidManifest.xml
Last active July 4, 2016 07:15
Android manifest entry for CopyToClipboardActivity with icon, label, and transparent theme
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="...">
<application ...>
...
<activity
android:name=".CopyToClipboardActivity"
android:exported="false"
android:icon="@mipmap/ic_copy_link"
@cketti
cketti / android-26-sources.md
Last active August 14, 2019 12:08
Build your own android-26 sources

If you are annoyed that "Sources for Android 26" are not yet available via SDK manager, this might be for you:

  1. Collect source files
mkdir android-sdk-source-build
cd android-sdk-source-build

mkdir -p frameworks/base