Category Archives: Android

Android Studio – using SensorEventListener.

This tutorial is about programming android hardware sensors service: TYPE_ACCELEROMETER.
You can start by using last version of Android Studio version 3.1.1 with the default project Empty Activity.
Is very simple to use accelerometer with Android Studio by read the values and show us into the text view area.
The SensorEventListener is used to read this values.
The MainActivity will need work with: … implements SensorEventListener.
This example can be used also like a good way to learn about this issues.
Note:

  • the implements is a keyword specific to interfaces, whereas extends is used to inherit classes;
  •  a class must implement all methods of an interface, unless the class is declared as abstract.

You need to change the default text Hello World from activity_main.xml file with this:

Make changes into MainActivity.java file
The functions: onSensorChanged and onAccuracyChanged is not created by I.D.E. and can be created by code inspections when you write the source code.

The result is a text with the values of accelerometer of your hardware.

Posted in All, Android, Programming. Tagged with , , , , .

JavaScript – Processing.js 2D library – part 004.

The Processing.js is available for Linux, Mac OS X, and Windows and come with the last version 3.3.7 (13 March 2018).
Today I tested processing.js for android. They say us about this issue:
Use Processing for Android to create Android apps with ease, including live wallpapers, watch faces, and VR apps. You can run your Processing sketches on Android devices (phones, tablets, watches) with little or no changes in the code, and without worrying about installing SDK files or editing layout files. Processing for Android also lets you accessing the Android API to read sensor data, and exporting your sketch as a signed package ready to upload to the Google Play Store.
To use processing.js for android you need to follow this links:

They tell us about new android processing :
The version 4.0 brings several improvements to the Android mode, incuding new functionality for creating live wallpapers, watch faces, and VR apps.

Posted in All, Android, javascript, Processing.js, Programming. Tagged with , , , , .

Go – Testing Golang with android application – part 001 .

This is my first tutorial in a long series about Go and Android programming. In the limit of my free time I will try to show you how to do simple applications with the Go programming language (or known as Golang).
You need to install the Go programming language using MSI installer from here.
I set the folder with this path – C:\Go\ but my windows also put some go files under Users folder.
If you want you can to add the Go path into windows environment.
You will have this path in this case: C:\Users\your_account\go\.
The next step is to install the Android NDK from here.
I install the Windows 64-bit into Users folder. You need to install at: C:\Users\your_account\go\.
Because I don’t have a good go programming android example I used the basic default example from golang mobile.
Let’s see the commands to install and used it:

About the gomobile command then the help tell us:

If you have the adb command installed on your machine, you can use gomobile command with the argument install to push the APK to your mobile device.
I used Bluestacks emulator for android and the basic example working well.

Posted in All, Android, Go, Programming, Windows 10. Tagged with , , , , , .

About Google Play Protect.

The Google Play Protect is part of the Google Play Store app, uses machine learning and app usage analysis to weed out the dangerous and malicious applications.
Google Play Protect for Android devices consists into this security features:

  • App scanning
  • Anti-Theft Measures
  • Browser Protection

You can read more here.

Posted in All, Android, web. Tagged with , , , , , .

Android UI – SeekBar example.

Today I will tell you how to make a user interface element called the seekbar with the Android Studio I.D.E.
On Android Studio select a new Empty Activity project, named it uiseekbar001.
You need to add the SeekBar UI and TextView UI into activity_main.xml file.
The textView, seekBar are variable for id into user interface elements and call by java file.
See the result:

You must interact with the user interface through the java file called MainActivity.java.
The
See this file:

The output will be a number text with value 24 sized by SeekBar up to value 100.

Posted in All, Android, Programming. Tagged with , , , , , , .