Category Archives: Android Development

Android hackers writing malware attack apps using App Inventor

There is no problem with using App Inventor to write your own apps and share them with others. The problem is that App Inventor makes it easy to write any app – and malware authors have begun to use App Inventor to create apps that are malware and might do bad things.

“App Inventor doesn’t give malicious apps any special powers nor access to exotic exploits to attack your phone. But it does make the production of Trojanized apps enormously easy. With only a basic understanding of Android programming, an attacker can churn out tons of malicious apps. More apps means more confusion, and more opportunities for attack.”

Source: Mobile Threat Monday: Android Attackers Use App Inventor for Evil | PCMag

Fewer professional coders in the future?

That is the actual future of software development: It will become so easy and second nature, that for ordinary tasks you won’t even have to think about it.

Source: Dear Google, the future is fewer people writing code | TechCrunch

Tools like MIT App Inventor, and others, are making programming so easy that it no longer requires extensive training and high levels skills to create many types of useful programs.

Specifically,

Writing code will become less and less necessary, making software development more accessible to everyone. This will allow people to solve new and unique problems for themselves, and true software engineers will continue to find ways to empower others through various platforms.

We used to call people who wrote programs, programmers. Later, this was change to titles like software developer, software engineer or sometimes computer engineer. Today, the media has short circuited the entire field to just “coders”, which seems like a downgrading of skills and title.

Using Location Information and GPS for finding your position

This tutorial introduces location services features available in App Inventor.

A future tutorial will demonstrate these features applied to specific applications.

About Android Device Location and GPS Features

Your Android device probably has built-in features to identify the device’s location. These features may include:

  • Global Positioning Satellite receiver (GPS)
  • Cellular network location information
  • Wi-Fi network location information

The GPS receiver interprets special (and very weak!) timing signals from satellites and uses those signals to compute latitude, longitude and altitude of your device. GPS has fairly good accuracy – correctly identifying the device’s position within as little as 5 meters (but which may at times be much wider such as within a 30 meter diameter circle accuracy). GPS accuracy is affected by the device’s ability to see the sky and may be blocked by buildings, trees and weather, and signals may suffer from ionospheric effects.

Cell phones can obtain information about the cellular network tower to which they are connected, including location information from the cellular tower.

Wi-Fi networks have a unique identifier associated with them (not the SSID public address). Google has built a map of wi-fi access point network locations using a combination of their Google mapping cars as well as everyone’s Android-powered cellular phone to build a huge database of wi-fi access points and their location. Your Android device can use a combination of location data and fetch a postal mailing address from Google for a given location.

Android phones have options as to which type of location information to use.

  • Cellular network information may be the least accurate, but it also uses the least amount of battery power.
  • Wi-fi network position information also uses little battery power, and can provide reasonably accurate location information when your phone is indoors and unable to hear signals from GPS satellites.
  • GPS provides the best accuracy but receiving and processing the signals uses the most battery power.

Your Android phone has options to select High accuracy, Battery saving and Device only.

  • High accuracy – Android will automatically select GPS, cellular or wi-fi to obtain a high accuracy position reading. This is likely the default setting on your phone.
  • Battery saving – Android will use cellular or Wi-fi networks to obtain position information.
  • Device only – Android will use the GPS receiver (greatest battery drain)

To select Location services, go to Settings | Location and set this feature to “On”.

Touch the item labeled “Mode” at the top of the screen to select “Location mode” options. This is where you may choose High accuracy, Battery saving or Device only.

Screenshot_20160516-175035To use any location features, you must turn Location to “On” in Android Settings!

MIT App Inventor has a component named LocationSensor providing access to latitude, longitude, altitude and even the postal mailing address associated with the location.

This tutorial introduces the LocationSensor and the basic properties and features. A future tutorial will go in to more depth.

Continue reading Using Location Information and GPS for finding your position

Using droid-at-screen to see your phone’s display on your computer

droid-at-screen is a free Java-based app that displays the content of your phone’s display to your computer’s display, when the phone is connected via a USB cable.

Below is a screen snap shot taken from my computer display. At the upper left is the Droid@Screen application running.  Droid@Screen is connected to my Nexus 5 phone.

At right is the display showing on my phone, which has been transferred from the phone to my computer over a USB connection. I’ve circled two user interface items – the magnifying glass icon is used to adjust the display size of the phone’s screen. Since the phone has a 1920×1080 display, the initial image is quite large!

Below that is a camera icon. Click on that to take a snapshot of what is on the screen, and then save the screen image to a local file.

Capture

At the lower left is the DroidAtScreen .jar file. This is the Java executable program file. Assuming Java is installed on your system, double click the .jar file to begin running Droid@Screen.

Continue reading Using droid-at-screen to see your phone’s display on your computer

Making “pretty” App Inventor user interface controls

In the real world, “user interfaces” look like electric light switches, push buttons or control knobs, temperature dials on ovens, volume controls on radios and so forth. We can mimic these types of controls for our touch screen Android apps. We do not have to rely on the boring desktop-like clickable button or checkboxes in the App Inventor user interface palette.

A previous tutorial showed a trick to make the color of a button vary continuously. This tutorial shows how to use our own images, instead of the boring button, together with a bit of code to bring these buttons to life.

User Interface View

Below is a sample “toggle switch”. Press the switch icon once and the toggle moves to the right; press it again and the toggle moves back to the left.

toggleswitch1

toggleswitch2

Here is a slide switch. Press the slide switch once and the switch position moves to the right and the switch illuminates in green. Press the slide switch again and the switch returns to the left.

switch1

switch3

Here is a concept for a raised momentary push button. Pressing the button changes the appearance of the button while your finger is on the button – to look like the button is pressed in.

UI1

UI2

The Designer View

Continue reading Making “pretty” App Inventor user interface controls

Measuring Android Power Consumption

I did my software engineering Masters thesis (2012) on Android power management and I learned, as part of my research, that most app developers have no idea how much power their app demands from their Android device’s battery.  Some who thought they were looking at power were confusing other metrics with power. At the time, tools for measuring power were not easy to obtain (costly, and hard to measure power inside a phone).

Now there is an app that provides many metrics about what apps are doing on Android, including power.

Go to the Google Play store, search for Trepn Profiler and install that app (from Qualcomm, who makes the Snapdragon processor used in most phones).

For a quick look at battery power in a strip chart format, select Network Activity and see a chart like this:

Screenshot_20151102-160041

Then select CPU Usage Monitor and identify what percent of CPU time is being used by each app. Initially the display will show “No applications are running” – wait a moment and gradually, apps will begin to show up in the list, with the % of CPU core they are using, shown at right. This may help you spot apps that are using an unexpected amount of power.

If possible, delete apps that you never or rarely use. Many lurk in the background and periodically run a fraction of a second, infrequently. While each individual app has little impact, the total of all apps may start to have an impact that you notice.

For more information about Trepn and estimating power consumption, read the linked article, below.

Trepn Profiler

Source: How to Measure Power Consumption Using Free Software | Mostly-Tech