Wednesday, February 27, 2013

Android Application Programming Basics

Android Application Programming Basics
Today I’m going to share a few of my notes about Android Application programming basics. Recently I’ve been trying to learn how to program Android applications. This post is not directly related to CAD but I will hopefully one day be creating some Android applications for CAD users.

Android Programming Acronyms
  • SDK = software development kit
  • DP = density pixels
  • IDE = Integrated Development Environment
  • UI = User Interface

Android apps are written in Java. I think it’s much harder to learn than writing macros for CATIA V5. When you write a macro, you can type up the code in a simple text editor and it is read top to bottom like a book. When writing code for Android applications, code must be inserted into at least three different locations within the Eclipse IDE software.

Pages or screens in Android apps are known as Activities. An Intent is a communicator with another application and you use it to change screens. To create a new activity right click on package: New>Class. Give it a name and set Super class as Activity, which will be a java file. Each activity needs a layout file (.xml) created by going to New>Android xml. Name it file_name.xml. Xml is a way to organize information with structure (as opposed to just using a text file). The xml file is used to organize the layout and properties of all the text, input boxes, buttons, images, etc. Buttons use a method called OnClickListener.

Alright, that might have sounded confusing to you, especially if you’ve never programmed before, so I’m going to leave it at that for now. Would you like to learn more about Android application programming? Please let me know and I will write more detailed posts. I’ve recently created two Android applications and they are available in the Google Play store for Free here.

In your opinion, what are the best CAD apps out there?