Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Friday, 24 June 2016

This Week I Learned - Week #168

This Week I Learned -

* Microsoft Azure Machine Learning Algorithm Cheat Sheet helps you choose the right algorithm for a predictive analytics model.

* Microsoft Data Science Virtual Machine (DSVM) is an operating system image available in the Azure Marketplace with a host of popular data science tools pre-installed and pre-configured.

* Azure SQL Data Warehouse can connect to Microsoft’s Azure Machine Learning libraries and Azure Data Lake.

* Mark Zuckerberg covers his laptop camera. The taped-over camera and microphone jack are usually a signal that someone is concerned, perhaps only vaguely, about hackers’ gaining access to his or her devices by using remote-access trojans — a process called “ratting.” (Remote access is not limited to ratters: According to a cache of National Security Agency documents leaked by Edward J. Snowden, at least two government-designed programs were devised to take over computer cameras and microphones.) - NY Times

* Based on the data gathered from Trend Micro Mobile App Reputation Service, malicious apps related to Godless malware  threat can be found in prominent app stores, including Google Play. The incident provides further evidence that users can't strictly trust official app stores to stay protected.

* Interesting facts from LinkedIn's Top Attractors list
- Half of CapGemini’s global workforce is based in India.

- Wipro (Western India Palm Refined Oils Limited) is one of India’s largest public companies and the seventh largest IT company in the world. Wipro has 170,000 employees on six continents and generates half of its revenues in the Americas.

- OYO’s founder and CEO, Ritesh Agarwal is just 22 years old and is the first resident Indian to win the Thiel Fellowship, a $100,000 grant from Paypal co-founder Peter Thiel.

- Cognizant was ranked #230 in the Fortune 500 list this year, up from #288 in 2015.

- Since 2012, Amazon has offered a program called "Career Choice," where the company pays 95% of tuition for its fulfillment and customer service center employees to take courses in non-work related fields, such as airplane mechanics, nursing, and medical lab technologies.

- Salesforce consulted monks when constructing areas for mindfulness in its offices. (Conservative Hindus swear by vasthu)

* The CEO of Goldman Sachs, a brand that for most of the world is the archetype of “Wall Street bank,” now tells anyone who asks that his company is actually a tech firm (and the fact that a quarter of its workforce is now engineers backs that up

* Dohaz.com does English translations of Hindi lyrics of mostly Bollywood songs


* Venezuela has shown that even in a country with the largest oil reserves in the world, it is possible for people to riot because there is not enough food. Economists say years of economic mismanagement — worsened by low prices for oil, the nation’s main source of revenue — have shattered the food supply.

* Natural gas, the kind used to heat homes and fuel gas stoves, is actually odorless. A chemical, called mercaptan, is added to the gas to give it a scent... of rotten eggs. This is done so that if a gas leak occurs, (which could be dangerous) humans can detect even the slightest whiff and report it ASAP

*  Michael Phelps, aged 30,  is the most successful Olympian in history with 18 golds, two silvers and two bronzes in his four trips so far. In 2014, he went into rehab after his second D.U.I. arrest in September 2014 (his first occurred when he was 19) "having no idea what to do with the rest of his life".

* In the book Man's Search for Meaning, Viktor E. Frankl argues that we have an incredible power to shape our attitudes and responses to the challenges life presents us and that we inevitably grow thanks to these challenges. We inevitably choose to be who we are...if we choose wisely, we can triumph even in tragedy. Life ultimately means taking the responsibility to find the right answer to its problems and to fulfill the tasks which it constantly sets for each individual

* "Stop saying learning to code is easy..."easy" sets folks up for failure and a lifetime of self-doubt" - Scott Hanselman 

Thursday, 12 May 2016

Beware of Mobile Apps which misuse access requirements

An excellent article by Shadma Shaikh in The Economic Times, highlights the dangers of Mobile Apps which misuse access requirements. Excerpts -

As India becomes a mobile app-economy, it is important for users to understand if apps indeed require access to so much of their data and device tools. 

Even if .. not paranoid about online security, you ought to be more careful about something else--mobile applications.Apps that read your contact list and your messages--including the ones about your bank transactions and one-time passwords, and access your pictures, screenshots and messenger images.

Permissions by themselves are harmless and even useful to provide users a good mobile experience. But since the list of permissions required is long and doesn't explain its effect, an immediate reaction is to treat it the way you would a `Terms and conditions' agreement--accept without reading the list and move to the next step. Skipping over these permissions could mean handing over your data to an oblivious app developer or unscrupulous data miners. 

Many apps ask for a host of permissions to access data and functions they don't require. The key lies in identifying the nature of the app and questioning what seem to be unnecessary requests.

The latest version of Google's Android operating system and Apple's iOS allow users greater flexibility in deciding what permissions to give to apps.

Developers, in the process of making apps more usable, end up asking for access to too many things the apps don't require, says Bryce Boland, chief technology officer, Asia-Pacific, at cyber security firm FireEye. Some well-known brands, too, have poorly coded apps that end up compromising on security, he said.

Yuval Ben Itzhak, former chief technology officer at security software company AVG Technologies, points out that if data leaving a device via an app is unencrypted--not converted into code to prevent unauthorized access--hackers can `look inside' it and get access to passwords, credit card numbers and other personal details.This is most likely to happen on public WiFi hotspots like those at airports, malls or coffee shops.

Apps often have permission to create and save files in various locations on your devices, some of which are retained even after the apps are uninstalled. A game app that you uninstalled could have retained images in your phone gallery. Another app that also has access to your gallery can now access those images.

A lot of this unnecessary access requirement also has to do with how apps are built and monetized. To make money out of apps, companies often integrate third-party libraries that allow these external entities to push ads and other content on their apps.Attackers can leverage poorly written code or third-party libraries to gain access to a user's phone or data

The Indian smartphone market that is dominated by second-hand and low-budget smartphones is more susceptible to mobile security attacks

As consumers, if an app is free, we need to figure how its developers make money. Is it by pushing ads or by providing a premium service upgrade in exchange of money?

Consumers who download apps without reading the permissions sought are also responsible for the increase in the number of `incidents' directed through mobile apps.

If people ditch apps that ask for a lot of permissions in favour of those that don't, app developers will be pushed to design apps in a way that they don't ask for unrequired permissions


Sunday, 8 May 2016

Smartphone Sensors

If you've wondered about sensors while reading about the spec of a smartphone, the official Android documentation for developers is a good place to learn more about them -
* Most Android-powered devices have built-in sensors that measure motion, orientation, and various environmental conditions.
* A game might track readings from a device's gravity sensor to infer complex user gestures and motions, such as tilt, shake, rotation, or swing. Likewise, a weather application might use a device's temperature sensor and humidity sensor to calculate and report the dewpoint, or a travel application might use the geomagnetic field sensor and accelerometer to report a compass bearing.
* The Android sensor framework lets you access many types of sensors.
* Few Android-powered devices have every type of sensor. For example, most handset devices and tablets have an accelerometer and a magnetometer, but fewer devices have barometers or thermometers. Also, a device can have more than one sensor of a given type.
* The Android platform supports three broad categories of sensors:
  - Motion sensors - accelerometers, gravity sensors, gyroscopes, and rotational vector sensors.
  - Environmental sensors - ambient light, pressure, humidity, temparature
  - Position sensors - orientation sensors and magnetometers.

Sensor Type Description Common Uses
ACCELEROMETER Hardware Measures the acceleration force in m/s2 that is applied to a device on all three physical axes (x, y, and z), including the force of gravity. Motion detection (shake, tilt, etc.).
AMBIENT TEMPERATURE Hardware Measures the ambient room temperature in degrees Celsius (°C).   Monitoring air temperatures.
GRAVITY Software or Hardware Measures the force of gravity in m/s2 that is applied to a device on all three physical axes (x, y, z). Motion detection (shake, tilt, etc.).
GYROSCOPE Hardware Measures a device's rate of rotation in rad/s around each of the three physical axes (x, y, and z). Rotation detection (spin, turn, etc.).
LIGHT Hardware Measures the ambient light level (illumination) in lx. Controlling screen brightness.
LINEAR ACCELERATION Software or Hardware Measures the acceleration force in m/s2 that is applied to a device on all three physical axes (x, y, and z), excluding the force of gravity. Monitoring acceleration along a single axis.
MAGNETIC FIELD Hardware Measures the ambient geomagnetic field for all three physical axes (x, y, z) in μT. Creating a compass.
ORIENTATION Software Measures degrees of rotation that a device makes around all three physical axes (x, y, z). The orientation sensor was deprecated in Android 2.2. As of API level 3 you can obtain the inclination matrix and rotation matrix for a device by using the gravity sensor and the geomagnetic field sensor  Determining device position.
PRESSURE Hardware Measures the ambient air pressure in hPa or mbar. Monitoring air pressure changes.
PROXIMITY Hardware Measures the proximity of an object in cm relative to the view screen of a device. This sensor is typically used to determine whether a handset is being held up to a person's ear.
A proximity sensor often emits an electromagnetic field or a beam of electromagnetic radiation (infrared, for instance), and looks for changes in the field or return signal. 
Phone position during a call.
RELATIVE HUMIDITY Hardware Measures the relative ambient humidity in percent (%). Monitoring dewpoint, absolute, and relative humidity.
ROTATION VECTOR Software or Hardware Measures the orientation of a device by providing the three elements of the device's rotation vector.
Game Rotation Vector Sensor does not use the geomagnetic field.
Geomagnetic Rotation Vector Sensor uses a magnetometer instead of a gyroscope
Motion detection and rotation detection.
TEMPERATURE Hardware Measures the temperature of the device in degrees Celsius (°C). This sensor implementation varies across devices and this sensor was replaced with the AMBIENT TEMPERATURE sensor in API Level 14 Monitoring temperatures.

Sensors not explicitly covered by Android documentation -
*  Hall effect sensors are used for proximity switching, positioning, speed detection, and current sensing applications
* Fingerprint Sensor
* Infrared Sensor

Related: Sensors supported by Windows Phone 10

Saturday, 12 March 2016

HOW TO scan a barcode with Android smartphone camera from a web page

If you need a barcode to be scanned from a mobile web app & then get back the code as text from the scanner, the ZXing ("Zebra Crossing") open-source, multi-format 1D/2D barcode image processing library & ZXing Barcode Scanner can help.

Note that this web page will only work when opened within an Android browser & smartphone with camera having ZXing Barcode Scanner installed

Here are the steps for a simple demo:
1. Create a webpage to initiate the bar code scanner through anchor tag.

When the ZXing Barcode Scanner application is installed on an Android device, a URL call to: zxing://scan/?ret=http://example.azurewebsites.net/desc.html?code={CODE}
..will bring up the device bar code reader so that the user can scans the code. The code is returned via the callback URL parameter supplied in the zxing URL.
2. ZXing Barcode Scanner will present the code to the file desc.html. To show that the code is in fact returned, I use a document.write(location.href); to show the returned barcode text