<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://wiki.johnharrison.cc/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://wiki.johnharrison.cc/feed.php">
        <title>wiki - lwc:programming:mobile:android</title>
        <description></description>
        <link>https://wiki.johnharrison.cc/</link>
        <image rdf:resource="https://wiki.johnharrison.cc/lib/exe/fetch.php?media=wiki:dokuwiki.svg" />
       <dc:date>2026-05-01T20:01:18+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:adb&amp;rev=1636668087&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:android_studio&amp;rev=1636855446&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:audio&amp;rev=1637681048&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:code_tricks&amp;rev=1641233869&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:firmware&amp;rev=1646759706&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:flash_mediatek&amp;rev=1644521810&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:global_constants&amp;rev=1645719728&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:http&amp;rev=1637634650&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:immersive_mode&amp;rev=1639493483&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:lambdas_and_friends&amp;rev=1645642743&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:libraries&amp;rev=1643735919&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:mqtt_service&amp;rev=1606451720&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:mqtt&amp;rev=1637270675&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:root&amp;rev=1641234103&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:runnable&amp;rev=1645651871&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:threads&amp;rev=1652313830&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:uncharted_waters&amp;rev=1645652581&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:updates&amp;rev=1638932976&amp;do=diff"/>
                <rdf:li rdf:resource="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:vibrator&amp;rev=1637634703&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://wiki.johnharrison.cc/lib/exe/fetch.php?media=wiki:dokuwiki.svg">
        <title>wiki</title>
        <link>https://wiki.johnharrison.cc/</link>
        <url>https://wiki.johnharrison.cc/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:adb&amp;rev=1636668087&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-11-11T22:01:27+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>adb</title>
        <link>https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:adb&amp;rev=1636668087&amp;do=diff</link>
        <description>ADB Magic

	*  find out the package name: adb shell pm list packages
	*  get the path of the package: adb shell pm path com.example.someapp
	*  pull the apk from the device: adb pull /data/app/com.example.someapp-2.apk
	*  disable debugging from adb:</description>
    </item>
    <item rdf:about="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:android_studio&amp;rev=1636855446&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-11-14T02:04:06+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>android_studio</title>
        <link>https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:android_studio&amp;rev=1636855446&amp;do=diff</link>
        <description>*  Build your first app

Tips and Tricks

Rename Project

From Change project name on Android Studio

	*  Close Android Studio
	*  Change project root directory name
	*  Open Android Studio
	*  Open the project (not from local history but by browsing to it)
	*  Clean project
	*  If your settings.gradle contains</description>
    </item>
    <item rdf:about="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:audio&amp;rev=1637681048&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-11-23T15:24:08+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>audio</title>
        <link>https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:audio&amp;rev=1637681048&amp;do=diff</link>
        <description>Reference

	*  Headset spec (including how to wire up buttons to headset
	*  detect button presses on Android</description>
    </item>
    <item rdf:about="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:code_tricks&amp;rev=1641233869&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-01-03T18:17:49+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>code_tricks</title>
        <link>https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:code_tricks&amp;rev=1641233869&amp;do=diff</link>
        <description>*  read file from sys directory
	*  looping techniques by time interval
	*  start application: adb shell monkey -p com.estrongs.android.pop -v 1</description>
    </item>
    <item rdf:about="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:firmware&amp;rev=1646759706&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-03-08T17:15:06+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>firmware</title>
        <link>https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:firmware&amp;rev=1646759706&amp;do=diff</link>
        <description>*  &lt;https://stackoverflow.com/questions/14432706/adb-command-to-open-settings-and-change-them&gt;
	*  &lt;https://android.stackexchange.com/questions/40719/where-are-android-settings-stored#:~:text=Most%20Android%20settings%20are%20found%20in%20%2Fdata%2Fdata%2Fcom&gt;.
	*  &lt;https://hybridego.net/2062&gt;
	*  &lt;http://muzso.hu/2012/08/10/how-to-pack-and-unpack-system.img-and-userdata.img-from-an-android-factory-image&gt;
	*</description>
    </item>
    <item rdf:about="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:flash_mediatek&amp;rev=1644521810&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-02-10T19:36:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>flash_mediatek</title>
        <link>https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:flash_mediatek&amp;rev=1644521810&amp;do=diff</link>
        <description>Flashing MTK Android 4.4 and 5.0 devices (Windows 10)

Install the VCOM drivers

	*  find &#039;em on Google 64 bit Windows 10
	*  They are unsigned so in settings --&gt; recovery choose advanced startup
	*  In the advanced startup menu choose option 7 to allow installation of unsigned drivers</description>
    </item>
    <item rdf:about="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:global_constants&amp;rev=1645719728&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-02-24T16:22:08+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>global_constants</title>
        <link>https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:global_constants&amp;rev=1645719728&amp;do=diff</link>
        <description>Global Constants

There seem to be a couple of ways to skin this cat but one way would be:

Add to BuildConfig

Example adding TAG DPF

In build.gradle the module not the project


buildTypes {
        release {
            ...
            buildConfigField &quot;String&quot;, &quot;TAG&quot;,&quot;\&quot;DPF&quot;\&quot;&quot;
        }
        debug {
            ...
            buildConfigField &quot;String&quot;, &quot;TAG&quot;, &quot;\&quot;DPF\&quot;&quot;
        }
    }</description>
    </item>
    <item rdf:about="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:http&amp;rev=1637634650&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-11-23T02:30:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>http</title>
        <link>https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:http&amp;rev=1637634650&amp;do=diff</link>
        <description>Reference

	*  TLSv1.2 with OKHttp and KitKat
	*  OKHttp examples</description>
    </item>
    <item rdf:about="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:immersive_mode&amp;rev=1639493483&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-12-14T14:51:23+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>immersive_mode</title>
        <link>https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:immersive_mode&amp;rev=1639493483&amp;do=diff</link>
        <description>Immersive Mode

KitKat (4.4)

Immersive mode shows a confirmation dialog that shows up the first time the app uses immersive mode. It then adds the app ID to a list of IDs to remember not to show the dialog box again. If the user turns off and on the device within 5 seconds the device assumes the user is in a</description>
    </item>
    <item rdf:about="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:lambdas_and_friends&amp;rev=1645642743&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-02-23T18:59:03+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>lambdas_and_friends</title>
        <link>https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:lambdas_and_friends&amp;rev=1645642743&amp;do=diff</link>
        <description>Functional Programming

Treating methods as first-class objects requires lambda functions. Very basic example:


public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //setContentView(R.layout.activity_main);
        testTheThings();
    }

    // to create a basic lambda function you need to have an interface for it.
    // that serves as a template for what the function w…</description>
    </item>
    <item rdf:about="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:libraries&amp;rev=1643735919&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-02-01T17:18:39+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>libraries</title>
        <link>https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:libraries&amp;rev=1643735919&amp;do=diff</link>
        <description>* CRC8</description>
    </item>
    <item rdf:about="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:mqtt_service&amp;rev=1606451720&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2020-11-27T04:35:20+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>mqtt_service</title>
        <link>https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:mqtt_service&amp;rev=1606451720&amp;do=diff</link>
        <description>*  MQTT client tutorial (code)
	*  PAHO android service (code)
	*  Cordova Android plugin (deserted)</description>
    </item>
    <item rdf:about="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:mqtt&amp;rev=1637270675&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-11-18T21:24:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>mqtt</title>
        <link>https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:mqtt&amp;rev=1637270675&amp;do=diff</link>
        <description>MQTT client libraries

	*  paho.mqtt.android
		*  active forks

	*  Hive MQTT Client
		*  Android Installation
		*  Quick start and General Documentation
		*  Java Docs
		*  Client Library Encyclopedia


paho.mqtt.android

	*  Current version supports API 24 and above
	*  Checked out 

HiveMQ MQTT Client

TLSv1.2 and Android 4.4

Android 4.4 has TLSv1.2 disabled. A possible workaround is to create our own socketfactory which supports TLSv1.2</description>
    </item>
    <item rdf:about="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:root&amp;rev=1641234103&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-01-03T18:21:43+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>root</title>
        <link>https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:root&amp;rev=1641234103&amp;do=diff</link>
        <description>Shuame

Shuame is a Chinese app for Windows. It could be Root Genius is the English translation. How can we be sure this is safe, not malware, not stealing IMEA numbers?

Videos

	*  How to Root every MTK China Phone takes you through making a recovery using stock ROM. Requires Preloader mode and a bunch of Windows apps. Walks you through generating a scatterfile.</description>
    </item>
    <item rdf:about="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:runnable&amp;rev=1645651871&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-02-23T21:31:11+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>runnable</title>
        <link>https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:runnable&amp;rev=1645651871&amp;do=diff</link>
        <description>Runnables and you

There&#039;s nothing special about a Runnable. It&#039;s doesn&#039;t have anything to do with threads. All it is is an interface, that&#039;s it:


  public class MyRunnable implements Runnable {

    public void run(){
       Log.v(&quot;MyRunnable running&quot;);
    }
  }</description>
    </item>
    <item rdf:about="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:threads&amp;rev=1652313830&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-05-12T00:03:50+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>threads</title>
        <link>https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:threads&amp;rev=1652313830&amp;do=diff</link>
        <description>A hodge-podge of tips, snippets, etc. in my journey to figure out the Android thread thing.

Run a routine every second

With Handler


final Handler handler = new Handler();
final int delay = 1000; // 1000 milliseconds == 1 second

handler.postDelayed(new Runnable() {
    public void run() {
        System.out.println(&quot;myHandler: here!&quot;); // Do your work here
        handler.postDelayed(this, delay);
    }
}, delay);</description>
    </item>
    <item rdf:about="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:uncharted_waters&amp;rev=1645652581&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2022-02-23T21:43:01+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>uncharted_waters</title>
        <link>https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:uncharted_waters&amp;rev=1645652581&amp;do=diff</link>
        <description>Android Java Stuff I really should digest someday maybe I hope it happens but yeah

	*  Excellent functional programming overview
	*  Lambda fully explained
	*  Threading options in Android</description>
    </item>
    <item rdf:about="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:updates&amp;rev=1638932976&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-12-08T03:09:36+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>updates</title>
        <link>https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:updates&amp;rev=1638932976&amp;do=diff</link>
        <description>Reference

	*  update app from within another app?
	*  another option
	*  https://github.com/NDMAC/apk-updater
	*  https://github.com/feicien/android-auto-update
	*  2018 blog about it (Requires at least API 21)
	*  Update Checker for API 8
	*  install without reboot by signing and zipaligning
	*  silent installs by calling shell commands

 Starting with API 21 it&#039;s possible to have a managed device mode which will allow for silent updates without root. Before this the app needs elevated privs.</description>
    </item>
    <item rdf:about="https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:vibrator&amp;rev=1637634703&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2021-11-23T02:31:43+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>vibrator</title>
        <link>https://wiki.johnharrison.cc/doku.php?id=lwc:programming:mobile:android:vibrator&amp;rev=1637634703&amp;do=diff</link>
        <description>Reference

	*  Vibrate with patterns</description>
    </item>
</rdf:RDF>
