Sunday, May 28, 2017

Nice and Toasty

Normal day, as always.

Imagine my surprise to see this page pop up:







Toast leaked?
My innocent little Toast popups, leak the Activity context?

Curious, I dug in, and sure enough








When you call Toast.makeText(Context, String, Int) a TextView object is created using your passed in context. This means that if you pass it a Service, BroadcastReceiver, or Activity context, and the Toast lingers around longer than the Context you give it, you will leak memory.

The easiest work around is to call Context.getApplicationContext() on whatever you pass into the Toast creation method. However, this can be annoying, because you would need to go through each toast call and do this.

To work around this annoyance, PYDroid now ships with a wrapper utility class called Toasty which does this for you and consumes the standard Toast.makeText() API.

Assuming a simple use of Toasts, simply run a find replace over your project, and replace all instances of Toast.makeText with Toasty.makeText, and you should be good to go (assuming you have autoimport set to resolve conflicts automatically).

========================
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: https://pyamsoft.blogspot.com

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

Saturday, May 27, 2017

Kotlin

It's new, it's cool.

It's a learning experience.

To this end, all pyamsoft applications will be re-written to use 100% Kotlin.
PYDroid has already been re-written to use 100% Kotlin code, and Power Manager version 7 - although still in progress - is also written with 100% Kotlin code and will ship fully running on Kotlin.

PYDroid in it's re-written Kotlin form should still be 100% backwards-compatible to its most recently released Java version.

Kotlin is cool and a neat alternative to standard Java on Android, and you'll be seeing a lot more of it in the pyamsoft future.

========================
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: https://pyamsoft.blogspot.com

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

Saturday, May 20, 2017

Future Plans

Lots of nice changes to see at Google IO this year.

Future plans are going to be as follows:

Redesign Power Manager, release the new version 7. I'll have mockups/images soon for what the new flavor will look like, but its going to be simpler to use and more aggressive at saving battery out of the box.

Next will be a version bump to PadLock which will replace the tiresome swipe motions to pull out the navigation drawer for a simpler bottom navigation bar. Additional fixes to locking logic should bring better battery life and faster performance.

Media player application will be geared up for release next. Initial version will be intentionally simple, so that I can see what features work and which do not. It will also allow me to use community feedback to figure out what features are highly requested, and implement them sooner.

The theme of all of these changes is the same as Google's theme for its next Android flavor: performance, battery, and core vitals.

The incoming changes to the applications will make them more stable, better performing, and less battery hungry. More to come.

========================
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: https://pyamsoft.blogspot.com

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