If you are like me then you might have a tendency to bite your nails, pull your hairs or keep doing something which you want to get rid off. Problem in such cases is awareness.
Soon you might be able to tame these habits using a wearable device. HabitAware has created a device called Liv.
A smart bracelet that creates awareness of subconscious behaviors like hair pulling, nail biting, skin picking and thumb-sucking in older children.
Willingness to change is the first step. Awareness is the second. Liv helps with this second step.
You saw why using modules is important and how to create a Java module in an earlier Post. In a similar fashion you can add an Android module to your project.
Android Studio makes it easy to add a new module. Follow the video to understand the steps.
An ADB is a command line tool which can be used to communicate with Emulator or Android Devices.
When your development machine needs to communicate with an Android Device it does so using ADB. It’s a process that is controlled by a command also known as adb.
The adb command works by talking to an adb server which runs in the background at port 5037. The server is also known as adb daemon or adbd.
Android Studio also talks to this server when it needs to run an app via an Android Device.
NASA recently undertook a new endeavor to allow long observations on Science phenomenon using Balloon technology. Mind you it’s not your average Balloon.
It attempts to detect Gamma Rays emitted from Black Holes and Exploding Stars.
It was launched from New Zealand and will orbit Earth for around 100 days.
Once you have transferred an APK file to your Android device its stored in /data/app/<package-name>
The classes.dex file is extracted from it and it’s converted to native library, when the App is run the first time, and stored in /data/dalvik-cache. This Machine Code can be run by the CPU.
Each Android device runs a process called Zygote. When an App needs to run Zygote creates a forked version of itself. Which means its a process in memory. Using this forked process and by loading the native library the App can be loaded pretty quickly.
If you are familiar with the Java Virtual Machine(JVM) then you will know that a JVM works on class files which are comprised of byte code. A class file is a compiled version of the Java code.
When it comes to Android then the Java code is first compiled to a class file which in turn is converted to a file called classes.dex – Dalvik Executable format. This is done by a tool called dx
Like JVM in Android’s case its Dalvik which works on the dex file.
A JVM is stack based processor whereas Dalvik is register based. Both are virtual processors though.
The classes.dex file is then compressed with a bunch of other files, like resource and data files, into a ZIP file called an Application Package or APK
This is the file you will eventually upload to the Google Play Store.
You are familiar with how to respond to user clicks in a ListView using an OnItemClickListener. RecyclerView does not have a similar set of built in functionality so you will have to write some code to handle user clicks.
The code you will add will be in the Adapter’s onBindViewHolder. You will also add an interface, similar to the ay you did for Fragment interaction.
Follow the steps below:
Add a Listener interface to the Adapter.
public static interface Listener{
public void onClick(int position);
}
Add a setListener method. This method will be called from the Activity.
public void setListener(Listener listener) {
mListener = listener;
}