Final Project Document : Runner Maker

Category : Always on, Always connected · No Comments · by Apr 13th, 2013

The goal of Final project

: 1.Pulling data out from fitbit API
: 2.Creating Pseudo User Interface
: 3.Creating Processing sketch that could demonstrate the basic idea.
How quantified running data will be reflected into game.

The Ultimate Goal : Life Simulation game in social platform

:: Adding different type of quantified data( Instead of using Fitbit, using more general device)
:: Not just competing in running, but also expanding to many other activities.
(More likely Princess Maker Game to augment virtual reality )

Inspiration : Life Simulation Game

Princess Maker 2
Princess Maker 2 Game structure

References for Gamification (Click links below)

1.Jane McGonigal: Gaming can make a better world
2.Jane McGonigal: The game that can give you 10 extra years of life
3.Ali Carr-Chellman: Gaming to re-engage boys in learning

Implementation

1. First step : getting data from fitbit

fitbit total feedback

Using MyTrack API into Eclipse

Category : Always on, Always connected · No Comments · by Mar 28th, 2013

How to import myTrack data into Eclipse?

Screen Shot 2013-03-28 at 6.14.07 PM

Mytrack is an Android app in google play that can records your path, speed, distance, and elevation while you walk, run, bike, or do anything else outdoors. While recording, you can view your data live, annotate your path, and hear periodic voice announcements of your progress.

Link : mytrack in Google play

To utilize myTrack in another android app,
you need to obtain Google Maps Android API v2
::Warning:: Google Maps Android API v1 will not be compatible with mytrack

Getting a key for Google Maps API v2

google api key

Camera Capture with full size image

Category : Always on, Always connected · No Comments · by Mar 15th, 2013

2013-03-14 23.00.50















Full fuction Camera

package com.example.largedispalycamera;

import java.io.File;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.Display;
import android.widget.ImageView;
import android.app.Activity;
import android.view.Menu;

public class MainActivity extends Activity {

final static int CAMERA_RESULT = 0;
ImageView imv;
String imageFilePath;

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

imageFilePath = Environment.getExternalStorageDirectory()
.getAbsolutePath() + “/myfavoritepicture.jpg”;
File imageFile = new File(imageFilePath);
Uri imageFileUri = Uri.fromFile(imageFile);

Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
i.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, imageFileUri);
startActivityForResult(i, CAMERA_RESULT);
}

protected void onActivityResult(int requestCode, int resultCode,
Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);

if (resultCode == RESULT_OK) {
// Get a reference to the ImageView
imv = (ImageView) findViewById(R.id.ReturnedImageView);

Display currentDisplay = getWindowManager().getDefaultDisplay();
int dw = currentDisplay.getWidth();
int dh = currentDisplay.getHeight();

// Load up the image’s dimensions not the image itself
BitmapFactory.Options bmpFactoryOptions = new BitmapFactory.Options();
bmpFactoryOptions.inJustDecodeBounds = true;
Bitmap bmp = BitmapFactory.decodeFile(imageFilePath,
bmpFactoryOptions);
int heightRatio = (int) Math.ceil(bmpFactoryOptions.outHeight
/ (float) dh);
int widthRatio = (int) Math.ceil(bmpFactoryOptions.outWidth
/ (float) dw);

Log.v(“HEIGHTRATIO”, “” + heightRatio);
Log.v(“WIDTHRATIO”, “” + widthRatio);

// If both of the ratios are greater than 1,
// one of the sides of the image is greater than the screen
if (heightRatio > 1 && widthRatio > 1) {
if (heightRatio > widthRatio) {
// Height ratio is larger, scale according to it
bmpFactoryOptions.inSampleSize = heightRatio;
} else {
// Width ratio is larger, scale according to it
bmpFactoryOptions.inSampleSize = widthRatio;
}
}
// Decode it for real
bmpFactoryOptions.inJustDecodeBounds = false;
bmp = BitmapFactory.decodeFile(imageFilePath, bmpFactoryOptions);
// Display it
imv.setImageBitmap(bmp);
}
}
}

Android Development basic

Category : Always on, Always connected · No Comments · by Mar 14th, 2013

Toast

toast

package com.example.toastapp;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends Activity implements OnClickListener {

Button myButton;
TextView myTextView;

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

myButton = (Button)findViewById(R.id.button1);
myTextView= (TextView)findViewById(R.id.textView1);

myButton.setOnClickListener(this);

}

@Override
public void onClick(View v) {
myTextView.setText(“Toast class test”);
Toast t = Toast.makeText(this, “Toast is here!”, Toast.LENGTH_LONG);
t.show();

Activity LifeCycle

Reference :

activities life cycle

Screen shot

package com.example.activityapp;

import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends Activity implements OnClickListener{

TextView myTextView;
Button myButton;

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

myTextView= (TextView)findViewById(R.id.textView1);
myButton = (Button)findViewById(R.id.button1);

myButton.setOnClickListener(this);
}

@Override
protected void onResume(){
super.onResume();
myTextView.setText(“initial state”);

}

@Override
protected void onDestroy(){
super.onDestroy();
myTextView= null;
Log.v(“MainActivity”, “onDestroy called”);

}

@Override
public void onClick(View clickedView) {
myTextView.setText(” Button is Clicked”);
}

}

savingStateSCreen

onsavingstate_log

package com.example.savingstatescreen;

import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;
import android.widget.EditText;

public class MainActivity extends Activity {

EditText myEditText;

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

myEditText= (EditText)findViewById(R.id.editText1);
}
@Override
protected void onSaveInstanceState(Bundle outState){
outState.putString(“editText1″, myEditText.getText().toString());
Log.v(“MainActivity”, “editText1″ + myEditText.getText().toString());

}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}

}

switching views

switchingViewApps

package com.example.switchingviewsapp;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class MainActivity extends Activity implements OnClickListener {

Button changeButton;

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

changeButton = (Button) this.findViewById(R.id.button1);
changeButton.setOnClickListener(this);
}

@Override
public void onClick(View clickedView) {
setContentView(R.layout.other);

}

}

 

LayoutInflator

layoutInflator

package com.example.layoutinflator;

import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends Activity implements OnClickListener {

Button myButton;
TextView textView;
TextView otherTextView;

LayoutInflater inflater;

View mainView;
View otherView;

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

inflater = LayoutInflater.from(this);
mainView = inflater.inflate(R.layout.activity_main, null);
otherView = inflater.inflate(R.layout.other, null);
myButton = (Button) mainView.findViewById(R.id.button1);
myButton.setOnClickListener(this);

textView = (TextView) mainView.findViewById(R.id.textView1);
otherTextView = (TextView) otherView.findViewById(R.id.otherTextView);

otherTextView.setText(“How Do I understand layoutinflator better?”);
setContentView(mainView);

}

@Override
public void onClick(View arg0) {
setContentView(otherView);

}

}

Multiple Activity

multipleActivity

 

 

Multiple Screen

multipleScreen

 

 

 

 

 

 

 

 

 

 

StartActivityForResult instead of just startActivity

Main Activity

package com.example.multiplescreens;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends Activity implements OnClickListener {

public static final int OTHER_ACTIVITY = 0;
Button changeButton;
TextView textView;

LayoutInflater inflater;

View mainView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

inflater = LayoutInflater.from(this);
mainView = inflater.inflate(R.layout.activity_main, null);

changeButton = (Button) mainView.findViewById(R.id.button1);
changeButton.setOnClickListener(this);

textView = (TextView) mainView.findViewById(R.id.textView1);

setContentView(mainView);

}

@Override
public void onClick(View v) {
Intent i = new Intent(this, OtherActivity.class);
startActivityForResult(i, OTHER_ACTIVITY);
}

protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
if (requestCode == OTHER_ACTIVITY) {
if (resultCode == RESULT_OK) {
// Get the data from the OtherActivity
String returnedData = intent.getStringExtra(“thedatatoreturn”);
Toast t = Toast.makeText(this, returnedData, Toast.LENGTH_SHORT);
t.show();
}
}
}

}

Other Activity

package com.example.multiplescreens;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class OtherActivity extends Activity implements OnClickListener{

Button finishButton;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.other);
finishButton = (Button) this.findViewById(R.id.button1);
finishButton.setOnClickListener(this);
}

@Override
public void onClick(View v) {
Intent resultData = new Intent();
resultData.putExtra(“thedatatoreturn”, “Yay!”);
setResult(Activity.RESULT_OK, resultData);

finish();
}

}

AndroidManifest.xml


package="com.example.multiplescreens"
android:versionCode="1"
android:versionName="1.0" >

android:minSdkVersion="8"
android:targetSdkVersion="17" />

android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:name="com.example.multiplescreens.MainActivity"
android:label="@string/app_name" >








Camera Capture with Intent

cameaCapture_01

package com.example.cameracapture;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.widget.ImageView;

public class MainActivity extends Activity {

final static int CAMERA_RESULT = 0;

ImageView imv;

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

Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
//startActivityForResult(intent, requestCode);
startActivityForResult(i, CAMERA_RESULT);
}

protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);

if (resultCode == RESULT_OK) {
Bundle extras = intent.getExtras();
Bitmap bmp = (Bitmap) extras.get("data");
imv = (ImageView) findViewById(R.id.ReturnedImageView);
imv.setImageBitmap(bmp);
}
}

}

How to take Medcines on time? ( User Interface Design )

Category : Always on, Always connected · No Comments · by Mar 14th, 2013

User Interface Research and Practice :

Gamification Idea for Android app

Category : Always on, Always connected · No Comments · by Mar 5th, 2013

http://en.wikipedia.org/wiki/Gamification

princess maker

Connecting

Category : Always on, Always connected · No Comments · by Feb 6th, 2013

Connecting

Description about this Video from Original Source

The 18 minute “Connecting” documentary is an exploration of the future of Interaction Design and User Experience from some of the industry’s thought leaders. As the role of software is catapulting forward, Interaction Design is seen to be not only increasing in importance dramatically, but also expected to play a leading role in shaping the coming “Internet of things.” Ultimately, when the digital and physical worlds become one, humans along with technology are potentially on the path to becoming a “super organism” capable of influencing and enabling a broad spectrum of new behaviors in the world.

————————————————————————————————————–

The content of the video is all about what I have thought about the advent development of wireless technologies including internet and mobile technologies. Connecting is the biggest issue of the 21st century as people want to be connected, getting attention from others. Radical improvement of wireless technologies have totally reshaped the way that we communicated others and now it enables us to communicate anyone in anytime without any difficulties we used to have in a decade ago.
Then, how is the life with better connectivity? Are we happier than before along with being connected with the flood of information and connectivity? Apparently, there is no way I can deny the advantage of technologies in terms of convenience. However, in terms of better quality of life, it’s not quite yet.

I believe this is the time we need to consider the quality of experience instead of concentrating on sole technological development. How do we make a world with better life quality, not just filling with all convenient devices,which at some point degrading humanity. How can technologies make people more human?
These are the questions that will follow me for another decade.

Is Cellphone replacing our reality? Yes, at some degree.

Category : Always on, Always connected · No Comments · by Feb 5th, 2013

Watch “Are Cell Phones Replacing Reality?” from the YouTube PBS Idea Channel and find some examples of the use of mobile technology the support or refute the idea. Post these to your blog.

I agree with the idea of replaced reality with our Cell phone in certain level. I would not insist that it literally replace our reality, but reshape our reality. We are now in the different Reality, perhaps we might need to re-define term “Reality”.  According to the definition of the Wikipedia, Reality is  a state of things as they actually exist, rather than as they may appear or might be imagined, which means our reality does not necessarily have to be related to the physicality of our body. Especially in digital norm, collection of our data represents us broadly more than who we are.