THE ANDROID DEVELOPMENT ENVIRONMENT - PART 1 - COURSERA

Programming Mobile Applications for Android Handheld Systems: Part 1
---------------------------------------------------------------------------------------------------------------------
University of Maryland
--------------------------------------

THE ANDROID DEVELOPMENT ENVIRONMENT - PART 1
============================================

JAVA DEVELOPMENT KIT download.

     The JDK is a development environment for building applications,applets,and components using the Java Programming Language.

The command file /sbin/init displays the linux operating system architecture, whether it is 32 bit or 64 bit.

Separate download and install of JDK and JRE.

**TIL: All write protected files to be removed bu using sudo.

**TIL: Copying the folder, copies the location of the folder, which can then be used in terminal by copy-paste.

**TIL: Packages still have to be installed from SDK Manager, after the configuration of studio. A lot of tools and packages available. Without them, the studio would not function properly.

For the "HelloAndroid" app, when I clicked the RUN command, it would not run, as there was not either a phone connected or any virtual machine was configured in AVD Manager (Android Virtual Devices). Went to create the AVD.

Need to create the virtual device on which the application would be tested or run. Android suggested that I use x86 version system images, and when I selected one, it further suggested me to enable KVM.

    KVM (for Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V). It consists of a loadable kernel module, kvm.ko, that provides the core virtualization insfrastructure and a processor specific module,KVm-intel.ko or kvm-amd.ko.

Checked whether:

                Hardware virtualisation was supported or not via command "$ egrep -c '(vmx|svm)' /proc/cpuinfo". The output was 1 and hence hardware virtualisation was supported.

                Then installed "cpu-checker" to see whether the cpu supports KVM or not. It was not supported. Went to BIOS settings and enabled Virtualisation.

                Ran the command "$ kvm-ok" and it replied "KVM acceleration can be used."

Installed the KVM via Ubuntu documentation help. Also installed virt-manager.

Started the Android Studio, but still for the "HelloAndorid" app, the rendering was not being done.

    Exception: Exception raised during rendering: com.android.ide.common.rendering.api.LayoutlibCallback.getXmlFileParser(Ljava/lang/String;)Lorg/xmlpull/v1/XmlPullParser;

Well, the problem was that I had selected API 21 - 5.0.1 for the current app, and the default layout being rendered was for API 23: Android N and hence the mis-match. Corrected that, and viola !

Now again went to task to create the AVD, now I was through the KVM part and x86 part, now Google suggested that I use a x86 system with Google APIs for use with Google Play.

Downloaded API 22 - 5.0.1 with Google APIs and now I dont see any remark. To proceed.

Though the AVD gets saved, but then it shows the Exception: SD Memory card not created.

All online threads pointing to KVM installation, but I have already done that, though I have not re-booted yet. Trying the good old "Reboot".

The reboot did not work, still the same error of "Failed to create the SD card".

The problem was that a package called ia32-libs was not installed and then mksdcard utility will not run without this utility. Further research threw that this package has about 240 dependencies. Holy shit !!! Then found that 4 packages can be installed separately, instead of installing all those dependencies and hence installed the following packages: "libstdc++6:i386 libgcc1:i386 zlib1g:i386 libncurses5:i386".

Took the name of Lord, went to the AVD Manager and started creating a new ADV, and viola it worked !!!

Finally, I believe, my installation of Android Studio is complete. Lets see...

Well, the emulator runs, but there are warnings that it may not run as defined, and then same happens.

Now for the emulator to work executing: "sudo apt-get install libsdl1.2debian:i386". Lets see...

Gradle build happened super fast and emulator also ran fast, but again the same error that all services are stopping.

Ok, After I saw the wrror log, there was one command that I had put in the Run>Edit Configurations, which was causing the problem. Removed that and tried again, the stuff is happening very fast, but still the same errors of all services stopping.

Installed the packages associated with the API of the AVD, but still not working.

Ah ! Though I all that, in Run>Configurations, I did not select the target AVD. Did that and now, no exceptions were shown in the console. Emulator opened and though there was this exception in the emulator "Google Play Services Stopped" but as I clicked the OK, the app opened beautifully.

Well, though the Google APIs are targeted but the dependencies of the play services and maps is not installed and hence the exception in the emulator.

Installed the dependencies but still not working.

Trying again after deleting the app. Deleting the app itself is such a cumbersome task. Need to delete the project folder from Android Projects directory too.

Screwed up some settings, again deleting the app and re-working.

Now after again starting a new project, the preview is not happening. New problem.

Finally it worked. Downlaoded the SDK for Marshmallow in the studio and then used Marshmallow in the app.

Now configuring an emulator also on Marshmallow. Some issue again with the Marshamllow Emulator. Continuous messages of "Device connected: emulator-5554" and nothing shows up on screen. Did not look into Log.

Reverted back to using 5.1 Emulator. The messages of Play Services stopping came, but the app did work.

To be Continued...

Comments

Popular posts from this blog

Coursera - CS 101 - Completed