Periodically, my Nexus 5 phone’s battery life is terrible. On good days, if I don’t use my phone, the battery discharge rate is slow – many hours later, the battery meter says there’s still over 90% of the battery charge remaining. But when it is bad, my unused phone can have its battery drain in 8 hours.
I have found two things to improve improve the battery life on my Google Android Nexus 5.
One is to clear the system cache partition – this cache setting is not accessible from Settings.
The other is to replace the Android launcher with Nova Launcher, available for free in the Google Play store.
How to Clear the System Cache Partition
To clear the system cache you need to enter a hidden Android start up menu, usually by starting your phone while pressing the power and volume control keys simultaneously. For specific instructions, see this explanation for the Nexus 5 (it might work on your phone too – this does work on my Nexus 5). Another list from a mobile phone service describes how to do this for other phones (I have not tested any of those).
Every few months, the battery life has gotten really bad. But after clearing the system cache partition, the phone returns to normal performance. I hope this works for you.
I noticed this might be related to my installing lots of apps on the phone, over and over again. Some days I’ll install my test app 10 or 20 or 30 or more times. After a few weeks of doing this every day, battery life problems develop. I clear the system cache partition and the phone is fine again.
You can learn more about the Android system partitions by reading this article.
As you may know, http is the old way to access a web site. https is the newer secure method that encrypts data sent to and from the web site.
Last year, Google announced it would rank search results such that web sites accessed via https rank higher than those using http.
This web page has been using http – which is okay since there is nothing secret or controversial about the content here.
However, on 7 March 2017, Firefox will launch an update that will issue a security warning when visiting web sites using http.
Consequently, we need to switch our web sites from http to https which involves paying a fee to buy an SSL security certificate and re-configuring software and servers.
I have successfully converted my coldstreams.com web site to https as a test for the conversion. So far everything looks good.
I will eventually convert the appinventor.pevest.com web site to use https also. I do not have a date for that – it could be next week or the end of the month. When I do the conversion, their might be a temporary period where you receive a security warning about accessing the web site, depending on how I do that update.
App Inventor programmers routinely store values, such as numbers or text strings (“Hello!”) in variables. For example,
stores the numeric value 6 in to the variable TOTALBUTTONS.
To illustrate by example, here is a global variable named SpecialButton. We can initialize it to anything we want at this point.
Next, inside our app, our blocks code assigns Button1 to the variable SpecialButton. SpecialButton now holds a reference to the actual user interface control Button1.
Since SpecialButton is a variable and not an actual button, we cannot directly use a SpecialButton.Click handler but we can use a feature of App Inventor to do the same thing in a different way. We will see how to do this in this a bit later.
You can store any App Inventor components – a Clock, a Bluetooth device – any component, in a variable.
Why would you want to do that? We will see in the example in this lesson.
This tutorial is in both written form and as an online video.
Just a quick update – I’ve been busy the past several weeks and did not get to complete the tutorials I had thought I would have done by now!
There are several topics I hope to cover soon including how you can store user interface components in App Inventor Lists. Say what?
Yes, you can create a list that contains, say, all the buttons you have on the screen. Why would you want to do that? Well you could use a simple for loop block to change the color of all the buttons simultaneously! And much more.
Another idea I’d like to implement is to modify my GPS app and have it send latitude and longitude coordinates to another phone using SMS messaging (instead of Firebase, as was done in that original version).
I’ve also done a little experimenting with creating Youtube video tutorials – but I have not posted any of these yet. I want them to have the right “feel” and quality before I put them online so I will continue to experiment with some ideas until I get them looking right.
Also, my apologies for not being on the Facebook group page very much. I’ll try to do better. Would you believe I did not even log in to Facebook for two weeks? My personal Facebook news feed (from friends!) has been overrun with angry and hostile political posts that turn off many people, including me. I just lost interest in logging into Facebook only to see a bunch of angry people expressing outrage every day.
I’ll try to better and get logged in this week and caught up. Lots of heavy rain the next few days so what else to do anyway?
Yesterday I posted another item in a series of posts about using Bluetooth features in App Inventor. Bluetooth (together with low power wireless technologies such as Zigbee) are significant technologies that make “The Internet of Things” possible. These low power wireless technologies enable all kinds of devices to communicate with each other and with other devices such as Android phones and tablets.
Today, most Bluetooth devices run Bluetooth version 2.1 up through version 4.2, depending on the device. Bluetooth has undergone considerable enhancements and evolution over the years from providing a short range, lower speed serial data link suited for wireless earphones to providing high speed packet data communications over short distances while using very low power.
Bluetooth continues to evolve with Bluetooth version 5.
Bluetooth 5 adds more improvements including:
Up to 4x longer range
Faster data rates – on par with WiFi for some applications
However – and this is important, most Bluetooth version upgrades require new hardware, and this is true for Bluetooth 5. To use version 5 features you will need version 5 compatible hardware – which is not yet generally available on Android phones and tablets.
This tutorial shows how an App Inventor app can communicate with 2 (or more) Arduino boards and Bluetooth devices simultaneously. These instructions assume you are familiar with the code and hardware presented in Part 1 and Part 2 and “How to connect App Inventor apps to Arduino using Bluetooth“. This tutorial uses the same Arduino source code as in that tutorial.
A follow up tutorial will show how to simplify some of this code for supporting multiple Bluetooth devices.
Bluetooth is a short range, low power, limited speed wireless communications technology. The original Bluetooth technology provided a serial communications link between two paired devices (as compared to an individual data packet sent between up to n devices using the much newer Bluetooth LE – see here and here for information on Bluetooth LE).
Arduino is a microcontroller board for building hardware projects. You can write software for Arduino using a programming language similar to the C++ programming language.
The code used in these examples has been tested with some specific Bluetooth modules connected to Arduino. These include the JY-MCU (Amazon (Prime), Amazon (non-Prime) and also some HC-05 and HC-06 based Bluetooth modules.
Build two Arduino boards each with an appropriate Bluetooth module as described in the prior tutorial.
Compile and load the Arduino software in to each of the Arduino boards.
Test and confirm that your basic LED lights flash for the original, single Bluetooth connection case.
Then, with two working boards, continue to this tutorial.
User Interface View
The original app supported just one device, so there was just a single “Connect” and “Disconnect” button. This version demonstrates how to connect more than one Bluetooth device so we need separate buttons for each device. Similarly, we must add a second status and data sending item to the screen:
Before running this app, be sure to use Android | Settings | Bluetooth to “pair” your Bluetooth devices with Android.
Then, run the app and select Connect to Device 1. This displays a list of available Bluetooth devices in the vicinity. Select your specific Bluetooth device for the connection. Do this for both Bluetooth devices.
Once connected, you can send some simple commands to the Arduino board. Commands are very simple – a single number – to tell the Arduino to do something (this confirms that the Bluetooth link is working). If we enter a single digit 1 and then press Send Numeric 1, the Arduino board will send back 2 bytes of data which will then be displayed on the app screen. If we enter a single digit 4 and then press Send Numeric 1, a value of 4 is transmitted over Bluetooth to the Arduino board, which responds by flashing the externally connected LED.
Because the text box for data entry has its property set to NumbersOnly, a pop up numeric keypad displays when entering data, rather than the usual Android text keyboard.
Video Demonstration this App
I created a short video showing this app in operation. There are two versions of the video – one is standard 2D format and the other is in VR 3D format for viewing on Google Cardboard-like viewers used with smart phones to watch VR videos.
Since 1 December, posts made here did not appear on Facebook or Twitter.
The software that transferred posts from this web site to social media stopped working and was no longer supported. The software developer had, in fact, given 9 months warning that the cross posting software would no longer be supported but I missed that announcement 🙂
I have installed and configured new software which appears to be working. The problem affected 4 web sites that I run so it took some time to find a good solution, test it out, and then roll it out to all of the other web sites too.
Now that this is done, I can get back to more interesting projects. I still have some Bluetooth related projects to finish and post here, plus I hope to post an interesting app that exchanges data between apps on different phones using text messages. I have not written that app yet but it looks straight forward – we hope!
App Inventor is the quick and easy way to write Android Apps