Giter Site home page Giter Site logo

indianpoptart / radiocontrol Goto Github PK

View Code? Open in Web Editor NEW
16.0 4.0 7.0 21.31 MB

An app that auto toggles wifi and cell radio for maximum battery life

Home Page: https://nikhilp.org/radiocontrol

License: GNU General Public License v3.0

Kotlin 100.00%
wifi maximum-battery-life cell-radio airplane airplane-mode project-fi android disable-radios kotlin

radiocontrol's Introduction

RadioControl

icon

Codacy Badge Join the chat at https://gitter.im/indianpoptart/RadioControl Android CI

Root IS Required! - XDA Guide

I created this app because of the lack of apps on the play store that enable airplane mode, while keeping WiFi on. Probably because not many carriers have WiFi calling and SMS over WiFi

RadioControl intelligently toggles WiFi and Cell radios to maximize battery life

This app will be useful to Google Fi, Republic Wireless, and Mint Mobile users, as these carriers support Talk & Text through WiFi.

Feel free to ask questions related to Android programming or this project in the public Gitter chat room. The issues page should be primarily used for bug reports and enhancement ideas.

This project attempts to follow Semantic Versioning.

Buy me a Coffee

If you like my work, consider buying me a cup of coffee! โค๏ธ

Buy Me A Coffee

Battery Usage by RadioControl

I have personally only detected a 0.3% decrease in battery with regular day to day use.

I will continue testing and possibly have an average battery usage(on my phone) per week

Versions

Latest Stable: Latest Stable Badge - Latest Stable Date badge

Current Beta: Latest Pre-release Badge - Latest Beta Date badge

Current Alpha: Latest Pre-release Badge - Latest Pre-release Date badge

Help me translate to your native language

https://crowdin.com/project/radiocontrol/invite

Compatibility

The app works properly, and has been personally tested on these devices:

  • Google Google Pixel/XL
  • Google Google Pixel 2/2XL
  • LG LG V10
  • LG LG V20
  • Motorola Moto X (2nd Gen.)
  • Motorola Nexus 6
  • Huawei Nexus 6P
  • LG Nexus 5X
  • LG Nexus 5
  • OnePlus OnePlus 1
  • OnePlus OnePlus 2
  • OnePlus OnePlus 3
  • OnePlus OnePlus 3T
  • Samsung Samsung Galaxy S7
  • Samsung Samsung Galaxy S7 Edge

As well as these Android versions

  • S(12.0) Android 12 - (Upcoming v6.0)
  • R(11.0) Android 11 - (Upcoming v6.0)
  • Q(10.0) Android 10 - (v6.0-alpha3+ - Cellular Mode(Experimental) not working)
  • P(9.0) Android 9 - (Debug version only)
  • Oreo(8.0) Android 8 - (Debug version only)
  • Nougat(7.0) - Android 7
  • Marshmallow(6.0) - Android 6
  • Lollipop(5.0+) - Android 5+

SU Binary Compatibility

Working properly with the following SU binary

Changelog

Check here for the new changelog

Dev Branch Status

Dev Branch Badge

Upcoming Features

Credits

Thanks to Mike Penz for the Material Drawer design

radiocontrol's People

Contributors

indianpoptart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

radiocontrol's Issues

Android Wear support

Add wear app that can run latency test through an interface, or through language processing(Ok google)

Add donation button

Allow the user to donate to me ๐Ÿ˜„

  • Add this to the about page, or as a separate drawer button

Carrier Logo loader

When checking for project fi, it only checks for Fi Network. Check for project fi as well

Calling issues

If a call is in progress, and you connect to WiFi, the call gets killed since the app runs through its code. Use this snippet

public boolean isCallActive(Context context){ AudioManager manager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE); 
    if(manager.getMode()==AudioManager.MODE_IN_CALL){
        return true; 
    } 
    else{ 
        return false; 
    }
}

Alpha Crash

Release: v3.0.1 - Alpha5
Device: Sony Xperia Z3C
OS: 4.4.4

I've got an instant crash as soon as I open up the application. Unfortunately there is no report crash, likely because it is installed via side-load rather than store. I'll see if I can capture a stacktrace at some point via adb. I'm a bit out of practice as I haven't done android dev in a few years now, any recommendations?

Network Alert misfires

Sometimes the Network Alert notification gets called too quickly. Add a pause somehow. Make the ping test on separate thread

Calling and Airplane mode

The app should have a setting to enable the cell radio during a call all the time or just when the wifi signal is weak

WiFi network settings bug

If the network settings list is empty, or doesn't exist, the app fails to function. Add a check for that.

New Network Join

Ask to add network to Network Settings when joining a new network

Calling and alternate radio command

When a call is placed/accepted/declined on cell radio, cell radio turns off. Only happens when the call ends(probably thwarted till the end due to the apps call protection code.)

Easter egg and link speed

  • AboutActivity.java Add this after class declaration:
private static final String PRIVATE_PREF = "prefs";
  • AboutActivity.java Add this after easter egg (version button) onClick code:
SharedPreferences sp = getSharedPreferences(PRIVATE_PREF, Context.MODE_PRIVATE); //Initializes prefs.xml
SharedPreferences.Editor editor = sp.edit();//Initializes xml editor

editor.putBoolean("isEasterEgg", true); //Puts the boolean into prefs.xml
editor.commit(); //Ends writing to prefs file
  • MainActivity.java Add this after initializing the LinkSpeed button, but before the onClickListener
//Check if the easter egg is NOT activated
if(!sharedPref.getBoolean("isEasterEgg",0)){
    btn3.setVisibility(View.GONE);
}

IAB Crash

In current beta v3.0-beta6

Crashes app when clicking any donate button.

Iabhelper purchase flow error

Do not disturb

Do not disturb does not work properly with alternate root command, only airplane mode

AlarmManager

Check for link speed, use to disconnect WiFi if link speed is too low

AlarmReceiver

public class AlarmReceiver extends BroadcastReceiver
{   

 @Override
 public void onReceive(Context context, Intent intent)
  {   
    //get and send location information
  }
}

ManifestSnippet

<receiver
    android:name="com.nikhilparanjape.radiocontrol.AlarmReceiver"
    android:exported="false">
</receiver>

AlarmManager

AlarmManager alarmManager=(AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent(context, AlarmReceiver.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent, 0);
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP,System.currentTimeMillis(),600000,
                                                                      pendingIntent);

Feedback Button

Make a way to send feedback to me, button already set, just make the method

WiFi Call Receiving

WiFi Calling seems to be broken. Unknown if cause is with app, or from amplify/greenify

Add to changelog

  • New! first-time user experience
  • New! Easy to access navigation drawer

SSID Disabler

Since the SSID disabler has created many issues, I will be removing it, and replacing it with the network alert feature. It will notify you of a connection that does not work

Network chooser

Add the ability to choose which networks you want the app to work in

Alternate cell switch

A way to turn off cell radio through command will turn just the cell radio off and doesnt enable airplane mode, can be used if someone is having problems with Bluetooth.

Investigate these commands

service call phone 27

service call phone 14 s16

Timer switch

If the timer is less than 10 seconds, and if WiFi doesn't connect, it runs through the code

Airplane manual bug

When the user taps airplane mode on in either settings, quick tiles, or a widget, radio control automatically turns off airplane mode (possibly detecting no wifi signal, and counterattack's by turning off airplane mode.

Before switching, check if wifi did just lose connection

Enable App button

From user:

RadioControl doesn't seem to understand "states" when it is
initially enabled. To get RadioControl to start working (when toggling
Disabled to Enabled), I ALSO have to subsequently manually toggle WiFi
off then on (presuming WiFi is connected, which one would think it
usually is). Not a good user experience. Some might think that the
program doesn't work, then uninstall.

  • Make RadioControl run the task when the enable button is flipped(Keep it unchecked as default)

ScheduledAirplaneService

It seems it is only running once, when the scheduled time is reached, and not getting set again.

EULA

Add EULA so people can opt in/ opt out of firebase crash logging

for v4.1-beta8 and up

Latency Test error

Replace error with partial packet loss, or the other latency test outputs

IAP Problem

Anytime someone clicks a donation choice, it says
Authentication is required. You need to sign into your Google Account

Change code snippet

Change code snippet found in WifiReceiver.java:

public int getCellStatus(Context c){
        TelephonyManager tm = (TelephonyManager) c.getSystemService(Context.TELEPHONY_SERVICE);
        List<CellInfo> cellInfoList = tm.getAllCellInfo();
        int z = 0;
        //This means cell is off
        if(cellInfoList.isEmpty()){
            z = 1;
        }
        return z;
}

To this:

 public boolean hasCellStatus(Context context){
        TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
        return tm.getAllCellInfo().size() > 0;
    }

Non-Root method

Find a way to get the app's core function to work without root

  • Add it as a non-root setting, keep root method if non-root method is less superior

StringIndexOutOfBoundsException

Happened while running a ping test

Stack:
java.lang.RuntimeException: An error occured while executing doInBackground() at android.os.AsyncTask$3.done(AsyncTask.java:304) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) at java.util.concurrent.FutureTask.setException(FutureTask.java:222) at java.util.concurrent.FutureTask.run(FutureTask.java:242) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.StringIndexOutOfBoundsException: length=421; regionStart=377; regionLength=-378 at java.lang.String.startEndAndLength(String.java:504) at java.lang.String.substring(String.java:1333) at com.nikhilparanjape.radiocontrol.rootUtils.Utilities.getPingStats(Utilities.java:110) at com.nikhilparanjape.radiocontrol.activities.MainActivity$AsyncBackgroundTask.doInBackground(MainActivity.java:929) at com.nikhilparanjape.radiocontrol.activities.MainActivity$AsyncBackgroundTask.doInBackground(MainActivity.java:900) at android.os.AsyncTask$2.call(AsyncTask.java:292) at java.util.concurrent.FutureTask.run(FutureTask.java:237)

Cell Service

Check the signal strength. If zero, no cell service, if not zero, cell exists

Donation one time setting

As of right now, when someone donates, they cannot donate to that bracket again. Eg. If someone donates $0.99, they can't do that again. Allow for consumable donations

Handle on-going call when WiFi signal drops

Test environment:
RadioControl is Enabled
Cell service disabled via Alternate root command
On-going phone call over WiFi

Problem:
If WiFi is lost while on phone call, the call will drop.

Solution:
Enable cell service at start of phone call for fallback.

Expected behavior:
Phone call will initially connect over WiFi and gracefully fallback to cell service if WiFi signal drops.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.