Archive for the Android Category

Android Hello, World Video Tutorial

Posted in Android, General, Java, Software Development with tags , , , , , on June 12, 2016 by jstevenperry

Check out my latest video Tutorial on YouTube!

In this video I show you how to:

  • Create an Android Studio project
  • Create an Android Virtual Device (AVD)
  • Run the Hello World program
  • Add custom behavior to the program
  • Add a string resource to strings.xml

Below is the main source code for the project.

MainActivity.java:

package com.makotogo.mobile.helloworld;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {

 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   setContentView(R.layout.activity_main);

   // Add button
   Button helloButton = (Button)findViewById(R.id.helloButton);

   helloButton.setOnClickListener(new View.OnClickListener() {
     @Override
     public void onClick(View v) {
       TextView textView = (TextView)findViewById(R.id.textView);
       textView.setText(R.string.seriouslyHelloWorld);
     }
   });
 }
}

activity_main.xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   xmlns:tools="http://schemas.android.com/tools"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:paddingBottom="@dimen/activity_vertical_margin"
   android:paddingLeft="@dimen/activity_horizontal_margin"
   android:paddingRight="@dimen/activity_horizontal_margin"
   android:paddingTop="@dimen/activity_vertical_margin"
   tools:context="com.makotogo.mobile.helloworld.MainActivity">

 <TextView
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:text="@string/helloWorld"
   android:id="@+id/textView"
   android:layout_alignParentTop="true"
   android:layout_alignRight="@+id/helloButton"
   android:layout_alignEnd="@+id/helloButton"/>

 <Button
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:text="Click Me!"
   android:id="@+id/helloButton"
   android:layout_marginTop="76dp"
   android:layout_below="@+id/textView"
   android:layout_centerHorizontal="true"/>

</RelativeLayout>

strings.xml:

<resources>
  <string name="app_name">HelloWorld</string>
  <string name="helloWorld">Hello, World!</string>
  <string name="seriouslyHelloWorld">Seriously, HELLO, WORLD!!</string>
</resources>

I hope you enjoy the video!

–jsp

New Makoto Java Android App: Policy Debate Timer

Posted in Android, Java on November 30, 2014 by jstevenperry

My company, Makoto Consulting Group Inc, released its first Android app, which is available now in the Google Play Store:


Get it on Google Play

Special thanks to Foster Perry for the design work and business analysis for the app.

–jsp

Android Invades the Desktop (ZDNet)

Posted in Android, Open Source, Software Development on June 26, 2013 by jstevenperry

Android Invades the Desktop (ZDNet)

This is really cool. Maybe I think that because I really like Android. But there’s something kind of neat about the idea of having a unified desktop between my mobile devices and my development workstation. Sure, there’s no IDE for Java (or any other language I know of) for Android. Yet. But stuff like this is a good first step.
Well done.