Android Simplicity

Simplicity For Simple People

Welcome to Android Simplicity. This website has been created to provide useful Android How-To, News, Reviews, and Database for those people with little to no time and knowledge to learn about the Android complex system.

Recent Post

Windows WSL2 Docker with PiHole and Unbound For Recursive DNS

Typically, when you search for a domain name, the resolver will recursively pass your request on until it finds the Authoritative Name Server. This can be a potential security hole as someone can easily track down all the url that you visited, as well as it's paths.

Unbound is a validating, recursive, and caching DNS resolver.

Pi-hole includes a caching and forwarding DNS server, now known as FTLDNS. After applying the blocking lists, it forwards requests made by the clients to configured upstream DNS server. 

By combining the two software, we can make sure that all DNS requests go straight to a Authoritative Name Server and eliminating the middle man (i.e. your own hosted Unbound becomes that middle man and finds the Authority for you in a nonrecursive mode). 

This article assumes you have general knowledge of how <a href="https://pi-hole.net/">PiHole</a> and docker works. 

*Note* If you are running pihole on a vm or hardware then just follow this guide

Steps:

1. Install docker

2. Create a docker compose file (PiHole_docker-compose.yml) using the code below in whatever path you decide to use: 

=============
version: '3'
services:
  pihole:
    image: 'pihole/pihole:latest'
    privileged: true
    restart: unless-stopped
    dns:
      - 127.0.0.1
      - 1.1.1.1
    links:
      - unbound
    ports:
      - '80:80'
      - '53:53/udp'
      - '53:53/tcp'
    environment:
      TZ: TZ=America/Chicago
      ServerIP: YOUR HOST IP GOES HERE
      WEBPASSWORD: YOUR PW GOES HERE
      DNS1: '169.254.0.19#5335'
    cap_add:
      - NET_ADMIN
    volumes:
      # ./Config will mount to the volume on your host machine and save the settings in the below locations
      - './config/pihole:/etc/pihole'
      - './config/dnsmasq:/etc/dnsmasq.d'
    networks:
      pihole_net:
        ipv4_address: 169.254.0.3
  unbound:
    image: klutchell/unbound
    restart: unless-stopped
    volumes:
      - './config/unbound:/opt/unbound/etc/unbound'
    networks:
      pihole_net:
        ipv4_address: 169.254.0.19
networks:
  pihole_net:
    driver: bridge
    ipam:
      config:
        - subnet: 169.254.0.0/29
==============

3. In the same location, create config/unbound directory

4. Create a new file named unbound.conf

5. Paste in the below code and modify as needed.

==============
server:
    # If no logfile is specified, syslog is used
    # logfile: "/var/log/unbound/unbound.log"
    verbosity: 0
    interface: 169.254.0.19
    port: 5335
    do-ip4: yes
    do-udp: yes
    do-tcp: yes
    # May be set to yes if you have IPv6 connectivity
    do-ip6: no
    # You want to leave this to no unless you have *native* IPv6. With 6to4 and
    # Terredo tunnels your web browser should favor IPv4 for the same reasons
    prefer-ip6: no
    # Use this only when you downloaded the list of primary root servers!
    # If you use the default dns-root-data package, unbound will find it automatically
    #root-hints: "/var/lib/unbound/root.hints"
    # Trust glue only if it is within the server's authority
    harden-glue: yes
    # Require DNSSEC data for trust-anchored zones, if such data is absent, the zone becomes BOGUS
    harden-dnssec-stripped: yes
    # Don't use Capitalization randomization as it known to cause DNSSEC issues sometimes
    # see https://discourse.pi-hole.net/t/unbound-stubby-or-dnscrypt-proxy/9378 for further details
    use-caps-for-id: no
    # Reduce EDNS reassembly buffer size.
    # Suggested by the unbound man page to reduce fragmentation reassembly problems
    edns-buffer-size: 1472
    # Perform prefetching of close to expired message cache entries
    # This only applies to domains that have been frequently queried
    prefetch: yes
    # One thread should be sufficient, can be increased on beefy machines. In reality for most users running on small networks or on a single machine, it should be unnecessary to seek performance enhancement by increasing num-threads above 1.
    num-threads: 1
    # Ensure kernel buffer is large enough to not lose messages in traffic spikes
    so-rcvbuf: 1m
    # Ensure privacy of local IP ranges. Remove ones you dont need
    private-address: 192.168.0.0/16
    private-address: 169.254.0.0/16
    private-address: 172.18.0.0/12
    private-address: 10.0.0.0/8
    private-address: fd00::/8
    private-address: fe80::/10
    # The action allow gives access to clients from that netblock.  It gives only access for recursion clients (which  is  what  almost all clients need).  Nonrecursive queries are refused.
    # The action allow_snoop gives nonrecursive access too. 
    access-control: 127.0.0.1 allow_snoop #Container ip address. Good for debugging in shell. 
    access-control: 169.254.0.0/16 allow  # Allow only bridged clients
==============

6. In Cmd run the following command: docker compose -p pihole -f "PiHole_docker-compose.yml" up -d


How-To #49: Connect USB Devices & Peripherals to Android with USB Host

Do you have an USB device that you want to connect to your Android? Most USB devices (such as mouses, keyboard, xbox dongles, flash drives, and even external hard-drives) are capable of running on the Android system. 

You may need to purchase a converter, as most phones use microusb, if your device does not have a standard USB port. USB host comes with Android 3.0(Honeycomb) and newer. There are times when the ROM or firmware that you have on your Android operating system may not have the driver/software for that particular device. 

That said, it is pretty rare to find a peripheral that is not supported. 

Requirement to run USB host. 
- Android 3.x and up
- Some USB host enabler that is specific for your device(most are micro-usb)

How-To #48: Play PSP Games Android Device

By now you probably know that the Android is capable of playing FLASH, GBA, NES, SNES, and SEGA games, but did you know that PSP games also works? 

Developers have created an emulator that have successfully played PSP games in .iso and .cso files. The app PPSSPP is still just a prototype and most PSP is not supported. 

That said, PPSSPP has huge potential so watch the video below, test out the app, and support the developer. Remember that you must dump or download the PSP games yourself as PPSSPP is only an emulator.

Getting Google Voice Search on ICS

Lets be honest, one of the main reasons to be on Jelly Bean is the awesome new Voice Search feature. The improved accuracy and response time makes Voice Search the new Siri killer. Now you can simply say stuff like "Will it rain tomorrow" and Voice Search will figure out the correct response.  

If you try to download Voice Search on a non-Jelly bean system, it will simply say "Your device is not compatible" and rejects the installation. Fortunately, rooted ICS users can get the app on their devices too using the steps below.



Steps to enable Google Voice Search on ICS Devices
Requirement: 
-Root
-ARMv7/ARMv6 devices only
-You must be on a deodexed ROM(most custom roms are)

Steps:
1) Download the zip file of the correct modded version of Google Now for your ARM device(see requirement - Links for ARMv6 and ARMv7)
2) Put the file in your SDcard.
3) Flash the zip in CWM. This will install Google Now into your app drawer
4) Install Google latitude installed set up the account for latitude
5) Open Google Now and go through the setup process. Click the "Yes, I'm in." option and your cards appear
6) Complete!


How-To #47: Map Android Keys To Any Keyboard

Ever plugged in an external keyboard with Bluetooth/USB and notice that some basic android key events are missing? Useful android key events such as the Home, Search, and Menu are critical to using any android system. For my Bluetooth keyboard, I had no Search key. This made it very difficult to find anything on my Android device. Each time I wanted to do the Search event, I had to press on the capacitive search key manually on the Android phone. There is a solution for this.

Requirements:
- Root
- KeyTest.Apk
- Any File Explorer(ES File Explorer: Go to "Settings"->Scroll down-> "Root Settings" -> Check all boxes) 

Steps:
1) Download, install, and open KeyTest.Apk on your Android Device

2) Press the hard key you want to simulate. I pressed on capacitive Search key on my Android device. 
There is a few things to know:
- You will see a "ScanCode": this is the number that maps the device. Mine is 217 (good to know but you dont need this information)
- You will see a "keyCode" under KeyEvent: this is the Action event. Mine is KEYCODE_SEARCH. Remember the value after KEYCODE_.

3) After the BlueTooth/USB is connected, pressed on any currently mapped keys that is not used. I Pressed FN+10 to simulate "F12"
- Write down the ScanCode. Mine is 88 

4) On the File Explorer, navigate to  /system/usr/keylayout. 

5) Find qwerty.kl(Older system) or Generic.kl(Newer system) and make a backup copy somewhere else.
*Note* You can check which one it is by opening qwerty.kl and it should say if it is depreciated near the top

6) Open qwerty.kl or Generic.kl. You will see a listing of "Key 'ScanCode' 'KEYCODE_ACTION' ". Find the ScanCode that was written down in step 3) above. Mine is listed as Key 88 F12

7) Change the KEYCODE_ACTION to the new mapping. Mine is changed to Key 88 SEARCH

8) Save the file and reboot

9) Done! Now whenever I press FN+10, I can simulate the Search key

Important Extra notes:
Android KeyCode - A long list of KEYCODE_ACTION events
- While you can use KEYCODE_ACTION more then once, you cannot use the same ScanCode more than once. This will cause the Keyboard to fail, so just use the on-screen touchkeyboard to replace qwerty/Generic.kl with the backup.

How-To #35: Connecting To Adhoc Networks on Android Tablets/Phones

Lets review the basics: firstly, what is tethering and Adhoc WiFi? Tethering is basically the sharing of internet connection of an internet capable device(host) with other devices(clients). 

The host device usually have internet connection from some kind of data plan such as 3G, 4G, and/or Edge. Obviously, it would be a waste of money to purchase data plans for every device that you own. 

How-To #46: Speed up Slow/Sluggish Android Devices

Have you started noticing that your Android device is running slow or sluggish? Well, you are not alone. It really is easy to keep your Android running like new. You just need to learn how to bring back the performance of the device and know how to keep it that way; as there is only a handful of problems that could slow down your device. 


Like any other computing devices, it requires regular maintenance and due diligence. Follow the steps below to greatly improve any Android.

1. Uninstall or Remove Unused Apps
Applications are great, espically the widgets, but once you start to install them on your device, they start to stack up to become a force that can greatly slow down the system. Ask yourself, do you really need that app? Also do not forget to keep a close eye on free apps, as the trend has become to display background ads on the notification bar.

Steps:
Go into Settings
Click on Applications
Click on Running Services or Manage Applications
Uninstall or stop any apps that you don't need

2. Install a Task Manager tool
Task managers are able to kill running apps. It can clear the RAM so that the Android system has more memory to work with. If you have alot of running apps with little to no ram, your system will feel close to a crawl.

Popular Posts
AndroidSim Mobile App
What are you using?