Dozens of minimal Android demo apps, each a example of one single Android API concept. Tested on Ubuntu 17.10 host, Android Studio 3, Android SDK 26, and an Android 6.0.1 device.
Switch branches/tags
Nothing to show
Clone or download
Latest commit 4518c66 Jan 25, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ActivityLifecycle bak Jan 7, 2018
AlertDialog bak Jan 7, 2018
AsyncTask bak Jan 7, 2018
Bitmap bak Jan 7, 2018
Button bak Jan 7, 2018
Camera bak Jan 7, 2018
CameraOneShot bak Jan 7, 2018
CameraPreviewVideo Non ndk builds Nov 19, 2017
ChangeView Non ndk builds Nov 19, 2017
Checkbox Non ndk builds Nov 19, 2017
EditText Non ndk builds Nov 19, 2017
EditTextGetText Non ndk builds Nov 19, 2017
Env Non ndk builds Nov 19, 2017
Fragment Non ndk builds Nov 19, 2017
Fullscreen Non ndk builds Nov 19, 2017
Handler Non ndk builds Nov 19, 2017
ImageView Non ndk builds Nov 19, 2017
IntentService Non ndk builds Nov 19, 2017
IntentServiceStartStop Non ndk builds Nov 19, 2017
IntentServiceTextView Non ndk builds Nov 19, 2017
LinearLayout Non ndk builds Nov 19, 2017
Location Non ndk builds Nov 19, 2017
Log Non ndk builds Nov 19, 2017
Min Non ndk builds Nov 19, 2017
NativeCodecMinimized Non ndk builds Nov 19, 2017
Ndk ndklog Nov 19, 2017
NdkCompiler Fix NDKs worth fixing Nov 19, 2017
NdkLibc bak Jan 7, 2018
NdkLog Fix NDKs worth fixing Nov 19, 2017
NdkOpencl.off ignore all .so in opencl attempt Dec 5, 2017
NdkSyslog Restore the new NDKs Nov 19, 2017
NdkTwoFiles Fix NDKs worth fixing Nov 19, 2017
Notification Non ndk builds Nov 19, 2017
Portrait Non ndk builds Nov 19, 2017
RadioButton Non ndk builds Nov 19, 2017
RelativeLayout Non ndk builds Nov 19, 2017
ScrollView Non ndk builds Nov 19, 2017
ScrollingMovementMethod Non ndk builds Nov 19, 2017
ServerSocket Non ndk builds Nov 19, 2017
SetBackgroundColor Non ndk builds Nov 19, 2017
SetLayoutParams Non ndk builds Nov 19, 2017
SetLayoutParamsLinearLayout Non ndk builds Nov 19, 2017
SetTextColor Non ndk builds Nov 19, 2017
Socket Non ndk builds Nov 19, 2017
TextViewBold Non ndk builds Nov 19, 2017
TextViewHyperlink Non ndk builds Nov 19, 2017
TextViewNewline Non ndk builds Nov 19, 2017
Toast Non ndk builds Nov 19, 2017
TwoActivities Non ndk builds Nov 19, 2017
VideoView Non ndk builds Nov 19, 2017
XmlLayout Non ndk builds Nov 19, 2017
.gitignore Merge branch 'master' of github.com:cirosantilli/android-cheat Jan 25, 2018
README.md bak Jan 25, 2018
aapt.md Save initial failed attempt at a manual xml layout with ant Feb 1, 2016
adb.md Many new NDK examples Jun 22, 2016
am.md Save initial failed attempt at a manual xml layout with ant Feb 1, 2016
android-command.md bak Mar 3, 2017
android-manifest.md ndk minimized Jan 26, 2016
ant.md Automate mass install / uninstall Mar 10, 2016
aokp.md native codec Feb 24, 2016
aosp-file-hierarchy.md Socket Mar 2, 2016
aosp.md Log and VideoView demos Feb 4, 2016
app-dependencies.md native codec Feb 24, 2016
apps.md Many new NDK examples Jun 22, 2016
background-jobs.md Socket client with AsyncTask, ignore libs for NDK Mar 13, 2016
bibliography.md sync Jul 10, 2016
boot.md Save initial failed attempt at a manual xml layout with ant Feb 1, 2016
build Merge branch 'master' of github.com:cirosantilli/android-cheat Jan 17, 2018
build-aosp bak Jan 25, 2018
build-aosp-hikey960 bak Jan 25, 2018
build-aosp.md bak Jan 17, 2018
close-app.md Automate mass install / uninstall Mar 10, 2016
configure Non ndk builds Nov 19, 2017
contribute-to-aosp.md sync Jul 10, 2016
cyanogenmod.md native codec Feb 24, 2016
debugging.md Many new NDK examples Jun 22, 2016
desktop.md Socket Mar 2, 2016
developer-options.md Start minimizing ndk Jan 26, 2016
device-cli-tools.md bak Mar 3, 2017
device-file-hierarchy.md bak Mar 3, 2017
dumpsys.md native codec Feb 24, 2016
emulator.md sync Jul 10, 2016
examples.md fullscreen, portrait Feb 12, 2016
fingerprint-sensor.md RadioButton Feb 14, 2016
gapps.md sync Jul 10, 2016
getting-started.md Restore the new NDKs Nov 19, 2017
gmail.md sync Jul 10, 2016
google-play.md sync Aug 26, 2016
gpu.md sync Jul 10, 2016
gradle.md Socket Mar 2, 2016
internals.md native codec Feb 24, 2016
location.md Location Feb 15, 2016
mobile-data.md sync Jul 10, 2016
monitor-app-power-consumption.md native codec Feb 24, 2016
ndk.md sync Jul 10, 2016
netcfg.md native codec Feb 24, 2016
networking.md Automate mass install / uninstall Mar 10, 2016
open-source.md native codec Feb 24, 2016
posix.md Many new NDK examples Jun 22, 2016
project-file-hierarchy.md Log and VideoView demos Feb 4, 2016
r.md TextView formatting, notifications, EditText get text Feb 8, 2016
repo.md bak Jan 17, 2018
root.md Save initial failed attempt at a manual xml layout with ant Feb 1, 2016
run Semi tested updating manifest up until camera, but android sucks and … Jan 7, 2018
sdk.md sync Jul 10, 2016
security.md Socket Mar 2, 2016
ssh.md cyanogenmod Jan 26, 2016
studio.md sync Jul 10, 2016
tablet.md Socket Mar 2, 2016
template Non ndk builds Nov 19, 2017
test.md imageview Feb 3, 2016
trivia.md Socket client with AsyncTask, ignore libs for NDK Mar 13, 2016
versions.md sync Jul 10, 2016
whatsapp.md Many new NDK examples Jun 22, 2016

README.md

Android Cheat

Dozens of minimal Android demo apps, each a example of one single Android API concept. Tested on Ubuntu 17.10 host, Android Studio 3, Android SDK 26, and an Android 6.0.1 device.

  1. Getting started
  2. Examples
    1. UI
      1. XMLLayout
      2. View
        1. TextView
          1. TextViewNewlinew
          2. TextViewBold
          3. TextViewHyperlink
          4. ScrollView
          5. ScrollingMovementMethod
          6. EditText
            1. EditText.getText
          7. Button
            1. Checkbox
            2. RadioButton
          8. setTextColor
        2. setBackgroundColor
        3. setLayoutParams
          1. setLayoutParamsLinearLayout
        4. ViewGroup
          1. RelativeLayout
          2. LinearLayout
        5. Media
          1. ImageView
            1. Bitmap
          2. VideoView
        6. Screen
          1. Fullscreen
          2. Portrait
      3. Activities
        1. TwoActivities
        2. ActivityLifecycle
        3. ChangeView
      4. Notifications
        1. Notification
        2. Toast
        3. AlertDialog
      5. Fragment
    2. BackgroundJobsTheory
      1. Handler
      2. IntentService
        1. IntentServiceTextView
        2. IntentServiceStartStop
      3. AsyncTask
    3. ServerSocket
      1. Socket
        1. SocketAsyncTask
    4. Hardware
      1. Camera
        1. CameraOneShot
        2. CameraPreviewVideo
    5. Location theory 1.Location
    6. Env
    7. Ndk
      1. NdkSyslog
      2. NDKLog
      3. NDKLibc
      4. NDKTwoFiles
  3. Theory
    1. Root
    2. Development
      1. Build AOSP
        1. build-aosp
        2. build-aosp-hikey960
      2. Contribute to AOSP
      3. Internals
        1. Device file hierarchy
        2. Networking
      4. android command
      5. adb
        1. Project file hierarchy
          1. AndroidManifest.xml
        2. ant
      6. Debugging
      7. Gradle
      8. Apps
        1. GAPPS
          1. gmail
        2. WhatsApp
      9. SDK
      10. aapt
      11. Studio
      12. Emulator
    3. AOSP
      1. repo
    4. Desktop
      1. POSIX
    5. Monitor app power consumption
    6. Mods
      1. CyanogenMod
      2. AOKP
    7. Google play
    8. Open source
    9. Trivia
    10. GPU
    11. Security
    12. Close app
    13. Fingerprint sensor

Chats

Mark all as read:

https://productforums.google.com/forum/#!topic/gmail/h-7PALCVZH0

Uninstallable apps

Some bloatware cannot be removed at all:

Bibliography

Small apps

Stay on top of other apps.

Sample application: take screenshot!

Screenshot

On Xperia Z3, Power key + volume down.

Icons

UI

Status bar

Topmost bar on the screen, contains several icons like signal .

Lock screen

What you see when you hit the power button.

Lock screen widgets

Removed apparently in Android 5.

http://www.androidauthority.com/lock-screen-widgets-android-lollipop-611516/

Toast

http://www.mkyong.com/android/android-toast-example/

Notification history

Notifications

Transfer data to SD card notification

Disable:

Application updated notification

Disable: http://android.stackexchange.com/questions/58021/how-to-get-rid-of-update-notifications-for-a-given-app-in-google-play-store

New voicemail notification

Disable:

Bloatware

Shitty software pre-installed by OEMs or carriers to get money from your personal information.

E.g., my Vivo (Brazilian carrier) + Sony Xperia Z3 has bloatware from both Vivo and Sony.

Apple forbids carriers from doing it it seems.

http://www.greenbot.com/article/2920125/dear-carriers-please-stop-putting-bloatware-on-my-android-phone.html

And on top of that, most bloatware cannot be uninstalled without rooting!!

Skins

GUI changes made by OEMs or carriers to steal your data.

Stock device

No bloatware.

Near stock devices: http://www.phonearena.com/news/Best-2015-smartphones-that-run-stock-or-near-stock-Android_id75780

Google play edition

Certified near stock devices.

https://en.wikipedia.org/wiki/List_of_Google_Play_edition_devices

http://arstechnica.com/gadgets/2015/01/dont-cry-for-the-google-play-edition-program-it-was-already-dead/

Died.

Google Nexus

https://en.wikipedia.org/wiki/Google_Nexus

No bloatware phones.

Strategy:

QR code scan

No built-in apparently:

Panoramic photo

Was installed by default on 5.1.1 Xperia Z3 as a "camera app".

Open the camera, and search for it.

App version

Find:

Linux file transfer

Media transfer mode

Mass storage mode

SSH method working: http://askubuntu.com/questions/189591/connecting-android-4ice-cream-sandwich-jelly-bean-kitkat-phone#comment1035980_222851

App isolation

Each App runs under a different UID: http://security.stackexchange.com/questions/67188/android-app-isolation-risks-implementation So it just reuses Linux's security.

HTML GUI

http://stackoverflow.com/questions/9045355/how-to-create-an-android-app-using-html-5 http://developer.android.com/guide/webapps/index.html

Android uses it's custom GUI API. Some day, maybe.

APK

Packaging format for android apps.

Aligned vs unaligned

http://stackoverflow.com/questions/22058210/why-unaligned-apk-is-needed

AOKP

https://en.wikipedia.org/wiki/AOKP

http://android.stackexchange.com/questions/50491/what-is-the-difference-between-aosp-and-aokp

ODEX

Optimizing apps

Dalvik cache

Replaced by ART in Android 5.

ART

Successor of Dalvik.

No JIT, full AOT is done.

x86

Java 8

Nope: http://stackoverflow.com/questions/23318109/is-it-possible-to-use-java-8-for-android-development

libc

Bionic, Google-made.

ROM

Read only memory.

Stores the OS.

Mounted under /system

If you root the device, you can change it, and make a custom Android however you like.

https://www.youtube.com/watch?v=RIi4KXgZYsI&feature=iv&src_vid=AWNykj-lb-I&annotation_id=annotation_162326159

USB debugging mode

TODO? What is that?

Enabled from Developer options

Disable the eternal notification: http://android.stackexchange.com/questions/5075/how-do-i-disable-the-usb-connected-notification

Tether

https://en.wikipedia.org/wiki/Tethering

Requires root, but available on Google Store.

Carriers may require you to pay for that if you tether from their network instead of LAN, which is why Android disables it by default.

Root allows you to re-enable that.

HBOOT

The Android bootloader?

Smart lock

Unlock in some cases without a password.

On-body detection: http://www.androidcentral.com/body-detection-explained Uses accelerometer.

Known WIFI not available it seems:

Piracy

Soft reset vs reboot

TODO?

Apparently soft rest is more superficial, and thus faster, but solves less problems.

Sony Xperia

Xperia Home

Reset home screen to device default:

Settings -> Apps -> All -> Xperia Home -> Clear data -> OK.

Do not disturb

Silent mode

Blocking mode

TODO where is it?? How to turn it on?

Linux run Android app natively

Peripherals

aar

Android library project

http://stackoverflow.com/questions/23915619/android-archive-library-aar-vs-standard-jar

fugu

http://www.androidpolice.com/2014/11/05/the-nexus-player-fugu-initial-android-5-0-factory-image-and-binaries-are-ready-to-download-now/

Screen pinning

http://www.cnet.com/how-to/ho-to-pin-apps-in-android-5-lollipop/

Phone without battery

If you link USB power cables directly to the battery energy entry points, it works: https://www.youtube.com/watch?v=f0IuBld2lzA

Secret codes

http://android.stackexchange.com/questions/35758/how-to-view-the-android-service-menu-secret-menu

Vary with Model, OEM and Carrier. TODO: are any built into the core?

Hardware

http://developer.android.com/guide/topics/sensors/sensors_environment.html

Enterprises

Open Handset Alliance

https://en.wikipedia.org/wiki/Open_Handset_Alliance

Hardware requirements

Memory:

Native libraries available

TODO Which native libraries must be available on all Android systems?

OpenCL: mostly not:

UART

Serial