Tuesday, March 31, 2015

Updates

So SoftGlow is "pretty much done" (unless I decide otherwise), and I'm looking to put in into final bugfix testing in a couple of days, but time is tight and my energy currently is limited.

Power Manager is undergoing a large change with its next version, expect to see Material features, animations, shading, quicker interaction, and an all around easier experience.

Home Button is looking to receive a small bugfix update as well in the near future.

A fourth project I have been thinking of expands on Home Button's idea of a software button replacement, only it changes a couple of things. For one, the scope of the project will be larger. Instead of just the Home Button, expect to see other functions, like volume control, brightness, lock screen actions, and of course, the home button all emulated in software. Also instead of being a static notification, the interface to the application will be floating, like the overlay currently in Power Manager.

Maybe, maybe.

========================
Follow pyamsoft around the Web for updates and announcements about the newest applications!
Like what I do?

Send me an email at: pyam.soft@gmail.com
Or find me online at: http://pyamsoft-official.blogspot.com/

Check out my Android Applications
Check out my Github Repositories
Check out my AUR packages

Follow my FaceBook Page
Follow my Google+ Page
=========================

Friday, March 20, 2015

Supporting Old Versions

First off, Old versions (API 10 Gingerbread) will still be supported by newer applications. But with the changes that Material brings there are many features, most importantly animation, that cannot be supported below API 15. While this sounds like an issue, as there are 5 API levels that are unsupported, there is only an estimated 6 percent of all Android users still running on an API below 15, and that 6 percent primarily consists of users on Gingerbread API 10. If you are one of those users I am sorry that you will not be able to take full advantage of the newer improvements, but I digress that I must continue to push for the adoption of new and improved Android versions, and creating applications which tether towards those versions over older one is one way to accelerate the push for Android versioning standardization.

tl;dr No animations for 15 and below, sorry!

========================
Follow pyamsoft around the Web for updates and announcements about the newest applications!
Like what I do?

Send me an email at: pyam.soft@gmail.com
Or find me online at: http://pyamsoft-official.blogspot.com/

Check out my Android Applications
Check out my Github Repositories
Check out my AUR packages

Follow my FaceBook Page
Follow my Google+ Page
=========================

Monday, March 9, 2015

i3-wm and Tiling Window Managers

So over the weekend I switched one of my systems from OpenBox to i3-wm and so far have been enjoying the experience. I have used tiling managers in the past, starting with DWM and then AwesomeWM, but went over to OpenBox because I wanted to try out a floating manager. But as it turns out, for most use cases in OpenBox I would simply maximize the windows or part them to both sides of the screen, kind of like what a Tiling manager does automatically.

So why continue to use OpenBox then if all I am doing is manually tiling windows myself in a stacking manager. So I made the switch, and right now its a very minimal system I've got going on. But I'm enjoying my time and especially enjoy the fact that i3-wm has operating "modes" ala Vim. More on that maybe later.

========================
Follow pyamsoft around the Web for updates and announcements about the newest applications!
Like what I do?

Send me an email at: pyam.soft@gmail.com
Or find me online at: http://pyamsoft-official.blogspot.com/

Check out my Android Applications
Check out my Github Repositories
Check out my AUR packages

Follow my FaceBook Page
Follow my Google+ Page
=========================

Thursday, March 5, 2015

Power Manager released!

An update to Power Manager has been released onto the store, and you should be receiving notifications on your device(s) soon. The update brings stability improvements, fixes a nasty crash with a bad vesion of Google Play Services, and introduces the first implementation of power triggers into the application. The fixes introduced are of large importance, and the update is recommended for all users to please download and install as soon as possible. With the release of 4.4.0, Power Manager will go into a stability period, where efforts will be focused on other projects, and Power Manager itself will shift it's focus to the next version, which looks to implement a cleaner UI, the themes and idea behind Material Design, and a smoother and more reliable operation all around.

========================
Follow pyamsoft around the Web for updates and announcements about the newest applications!
Like what I do?

Send me an email at: pyam.soft@gmail.com
Or find me online at: http://pyamsoft-official.blogspot.com/

Check out my Android Applications
Check out my Github Repositories
Check out my AUR packages

Follow my FaceBook Page
Follow my Google+ Page
=========================

Wednesday, March 4, 2015

Home Button

Home Button bugfix finally dropped as it took me a while to figure out what the problem exactly was. Initially, it appeared that the crash was happening in Android native code, so there was nothing I could do to fix it. Turns out it was a tiny bug in the Google Play Services package that caused a NoClassDefFound error. A simple fix and now we're rolling.

Power Manager is planned for the next week or so, although schedules will serve to decide when exactly I get around to finalizing it.

SoftGlow is going through a very long update process which I apologize for. There was a lot of cruft in the original release and I feel like this update merits a lot of work hours that are being put into it. Seeing as the last version was released about five months ago, I want this next version to really shine with its polish.

========================
Follow pyamsoft around the Web for updates and announcements about the newest applications!
Like what I do?

Send me an email at: pyam.soft@gmail.com
Or find me online at: http://pyamsoft-official.blogspot.com/

Check out my Android Applications
Check out my Github Repositories
Check out my AUR packages

Follow my FaceBook Page
Follow my Google+ Page
=========================

Thursday, February 26, 2015

Power Manager Enters Final Testng

The Power Trigger implementation should be completed in the next couple of days, meaning that Power Manager 4.4.0 will be entering a feature freeze in preparation for its release. After the freeze, I will only be fixing bugs, not adding any new features to the application. Development efforts for Power Manager will then be focused on the next version, which will bring a new visual theme as well as smoother interface and faster operation.

SoftGlow is still going through some rougher testing as I decide the direction I want to take with the application, though I believe I will figure that out soon.

Home Button is getting bugfixed for an occasional crash (that actually has to do with Google Play Services, not Home Button itself) that should be released soon as well.

Stay tuned!

========================
Follow pyamsoft around the Web for updates and announcements about the newest applications!
Like what I do?

Send me an email at: pyam.soft@gmail.com
Or find me online at: http://pyamsoft-official.blogspot.com/

Check out my Android Applications
Check out my Github Repositories
Check out my AUR packages

Follow my FaceBook Page
Follow my Google+ Page
=========================

Wednesday, February 25, 2015

Something something

The plan. The plan is.

After Power Manager updates to include Power Triggers, it will basically be stablized and the feature work will be frozen for a time. Work will then be focused on the next version of Power Manager, which I hope to be cleaner looking, more animated and faster, and smaller on memory.

But BEFORE that can happen, SoftGlow will be patched to stabilize both the included features and work towards the addition of new features like better time management for the amount of tint applied to the screen.

And a small patch for HomeButton that can help resolve a "maybe" issue, which I have been unable to reproduce but have received a couple of reports about.

========================
Follow pyamsoft around the Web for updates and announcements about the newest applications!
Like what I do?

Send me an email at: pyam.soft@gmail.com
Or find me online at: http://pyamsoft-official.blogspot.com/

Check out my Android Applications
Check out my Github Repositories
Check out my AUR packages

Follow my FaceBook Page
Follow my Google+ Page
=========================

Monday, February 23, 2015

Using Android as a SOCKS server

Yeah as a server. Why? There were plenty of pages floating around the web which said how to connect your Android to a SOCKS server, but very few told you actually how to use it as the server. So this is what I'm going to try and explain.

First let me state why I found this neccessary. My phone carrier disables the use of mobile data through a USB tethering setup except in the event of the user purchasing a "mobile data tethering plan". As a result, when I connect my device to a laptop and enable tethering, the laptop does not receive a network connection. So I set off to try and get around this limitation by tunnelling through a SOCKS server that I would host on my phone, therefore making it appear that the Android was making all of the web requests: no tethering plan needed.

By setting up a SOCKS server, you can use your phone's mobile data to power the network of your other systems, including a laptop which otherwise does not have any other connection to the network.

Essentially the setup is as follows:

Tether your Android by USB to your system.
Get an IP address on your system.
Get an Android SSH server application
Start an SSH server on the Android device
Start a SOCKS server off of the SSH server
Connect from your system to the SOCKS server and bind to a local port
Proxy any connections (browser, mail) through the local bound port.

So here we go.

Tether your Android. Google around if you need to know how to do this, as explaining it will be out of the scope of this post.

Once your Android is tethered, get an IP address for your system, either statically or dynamically. I used a simple dynamic address for this, using the Linux dhcpcd program. On other operating systems (and Linux distributions) the command will vary, so dig around.


NOTE

This post is written only with functionality in mind. It is up to you to figure out the necessary security measures for your specific setup. Some of the steps here may be insecure, or leave you visible to eyes on the Web. I will not be held responsible for your failure to adhere to good security practices.

Now the good stuff.

First you are going to need an SSH Server for Android. In this case, I used Servers Ultimate Pro which was free on the Amazon app store a few months back. You first need to open Servers Ultimate. Keep in mind this was written for version 6.3.10, though it can be applied I'm sure to other versions as long as they support/supported SSH and SOCKS servers. For this, you'll also need the free Server Pack E, which adds support for SSH.

Once inside the application, navigate to the "Servers" tab. Click the Action icon "Plus" to add a new server and select an SSH server. Name the server, give it a (random) port, and make sure that atleast the "Enable Shell" option is selected under the Protocol section in the "Specific" tab. You can also take the opportunity to add your own public key, if you know what that is, although the how to for doing that is out of the scope of this post. Click the save icon and you should be good to go.

Add a second server and make it a SOCKS server. Give it a (different random) port, and that's fine as well. Click "Save" and be on your way.

Click the Play button in the top rght of the "Servers" screen to start your SSH and SOCKS servers. Woohoo!

Now at this point you should have and know the following four things:

An IP Address for you Android Device which is tethered to your system, android-ip
An IP Address for your system needing Internet, system-ip
The port for the SOCKS server, lets call it socks-port
The port for the SSH server in general, lets call that ssh-port

Add one more thing to your list, which is the local port to bind to. Though the default is 1080, for the purposes of explination I'll be using a different port, called bind-port.

Now the part which may unnerve you if you aren't too command line familiar (although why would you be looking for SOCKS server setup instructions). You will ssh from your system to your Android. The command will look something like this:

    ssh -L <bind-port>:<android-ip>:<socks-port> -p <ssh-port> <android-ip>

    ssh -L 1080:192.168.0.111:1080 -p 22 192.168.0.111

alternatively you can use the dynamic port option instead:

    ssh -D <bind-port> -p <ssh-port> <android-ip>

    ssh -D 1080 -p 22 192.168.0.111

This will do the following:

Request an SSH connection to android-ip on port ssh-port. Once connected it will forward the local port bind-port on your system to the socks-port on the Android system. Now you've hacked together a SOCKS proxy for your system from an Android server.

At this point, your proxy is located at localhost:<bind-port>. Some programs have SOCKS proxy support built in, in which case you're good to go. For those that don't you may be able to pass the proxy as an argument to different programs for them to be able to use it, for example:

    google-chrome --proxy-server=socks5://localhost:1080
    curl --socks5-hostname localhost:1080


Finally you can create a configuration file in $HOME/.ssh/config which can contain something like the following:

    Host <proxy-name>
    Hostname <android-ip>
    Port <ssh-port>
    DynamicForward localhost:<bind-port>

and then you can connect to your proxy using

    ssh <proxy-name>


Using this, I was able to pull system updates, git updates (and push), emails from a Thunderbird client, and browse the web on Google Chrome and Firefox, without any WiFi connection or Ethernet connection.

And all without a mobile data tethering plan too.


NOTE

This post is written only with functionality in mind. It is up to you to figure out the necessary security measures for your specific setup. Some of the steps here may be insecure, or leave you visible to eyes on the Web. I will not be held responsible for your failure to adhere to good security practices.

Your mileage may vary.

========================
Follow pyamsoft around the Web for updates and announcements about the newest applications!
Like what I do?

Send me an email at: pyam.soft@gmail.com
Or find me online at: http://pyamsoft-official.blogspot.com/

Check out my Android Applications
Check out my Github Repositories
Check out my AUR packages

Follow my FaceBook Page
Follow my Google+ Page
=========================

Thursday, February 19, 2015

Handling Power Triggers

I'm wondering how to go about doing this.

Should I allow triggers to have the same names, or limit names to be unique only? Do I allow the user to leave a field blank and have it auto-populate, or do I force you to fill in everything? What to do, what to do.

Also, big update for pstate-frequency. Cleaned up all the ugly (lazy) exit calls, so now the program should exit without any memory left over. Refined the automatic power plan logic and removed the old crusty log interface. Number of allocations has been reduced significantly, takes very little memory now. Speed of execution has also been increased, which is always good, although the tool is arguably already fast enough.

More things as they occur.

========================
Follow pyamsoft around the Web for updates and announcements about the newest applications!
Like what I do?

Send me an email at: pyam.soft@gmail.com
Or find me online at: http://pyamsoft-official.blogspot.com/

Check out my Android Applications
Check out my Github Repositories
Check out my AUR packages

Follow my FaceBook Page
Follow my Google+ Page
=========================

Wednesday, February 11, 2015

Reflection

Let's talk about reflection and "private" APIs.

Power Manager uses this specific snippet of code to be able to toggle Mobile Data on (almost all) Android devices. Up until Android Kitkat(4.4), this was a perfectly working, albeit ugly solution, which used a feature of the Java programming language called "reflection":


/*
 * Get the state of mobile data
 * returns false if disabled, true if enabled
 */ 
public final boolean getMobileDataEnabled(final Context context) {
    final ConnectivityManager manager = 

        context.getSystemService(Context.CONNECTIVITY_SERVICE); 
    final String methodName = "getMobileDataEnabled";
    final Method getMobileData = ConnectivityManager.class 

        .getDeclaredMethod(methodName);
    method.setAccessible(true);
    return (Boolean) method.invoke(manager);
}


/*
 * Set the state of mobile data
 * true enables data, false disables data
 */ 
public final void setMobileDataEnabled(final Context context, final boolean state) {
    final ConnectivityManager manager = 

        context.getSystemService(Context.CONNECTIVITY_SERVICE); 
    final String methodName = "setMobileDataEnabled";
    final Method setMobileData = ConnectivityManager.class 

        .getDeclaredMethod(methodName, Boolean.TYPE);
    method.setAccessible(true);
    method.invoke(manager, state);
}
 

This ugly reflection solution was all that a developer could do to work with the mobile data on an Android device, as there was no public API available for standard use. Was reflection good? No. It was a hack to get around limitations, it was unsupported on some devices, and it could disappear with no warning. But reflection was all we had as developers. And it stuck around on Android for the first 19 versions, all the way up to Kitkat 4.4.

In the new Android, Lollipop (5.0), all of this has changed.

There is no way to access or modify the state of the mobile data connection in Android Lollipop.
No way at all*. Any developer looking to perhaps, save power by toggling the state of mobile data on a device, will have no way to do so on Android Lollipop, and there is nothing that anyone can do at the moment.

With the growing adoption of Android Lollipop, I would just like to make this knowledge known in the hopes of avoiding angry users who do not understand why they can no longer use Power Manager or other related applications to toggle the mobile data of their device any longer. If you boot up one day to find Lollipop on your phone, and Power Manager no longer works to toggle data, please understand that I am powerless to do anything about it.

*Technically, there are system-accessible methods which do exist to change the state of mobile data, however, they are unusable by normal applications. See Android Issue tracker (78084, 81091).

========================
Follow pyamsoft around the Web for updates and announcements about the newest applications!
Like what I do?

Send me an email at: pyam.soft@gmail.com
Or find me online at: http://pyamsoft-official.blogspot.com/

Check out my Android Applications
Check out my Github Repositories
Check out my AUR packages

Follow my FaceBook Page
Follow my Google+ Page
=========================