Friday, April 18, 2014

How to Access LocalHost on an Android Emulator

Last time I wrote about how to access LocalHost for Android phones. As it turns out, accesssing LocalHost on emulators are also different.

To access LocalHost point your device to 10.0.2.2:[PORT NUMBER].

Enjoy testing your app on the emulator.

Saturday, April 12, 2014

Using AWS SDK For Android

If you want to implement file upload to AWS S3 as part of your Android app here are some tips to get you going.

Setup

  1. Download the Android-AWS SDK
  2. Unzip the downloaded package then go to the lib folder
  3. In the lib folder copy aws-android-sdk-[version]-core.jar and aws-android-sdk-[version]-s3.jar
  4. Use the mechanism your IDE has provided add these jar files and make it available in code. (For Android Studio 0.5.4, I manually added it to the app > lib folder and right clicked on the jar files and select Make Module

Coding


// Create a new S3Client with your credentials. You could get the Keys from the IAM console.
AmazonS3Client s3Client =
new AmazonS3Client(new BasicAWSCredentials("ACCESS KEY", "SECRET KEY");

// Create a PutObjectRequest. This is used to communicate with AWS and upload your file
// The KEY is the full file path to where your file should be stored on AWS.
// For example, images/category/subcategory/image_name.jpg
// The FILE is a file object that you want to upload
PutObjectRequest putObjectRequest = new PutObjectRequest("BUCKET", "KEY", "FILE");

// Now tell AWS S3 a that you want to upload an image with the specifications above.
s3Client.putObject(putObjectRequest);

Tuesday, April 8, 2014

Setup A Superuser Account With Password On A Postgres Database

I program on Ruby on Rails and when you start off you could use SQLite as the local database, which doesn't require any setup to get things up and running. However, when your application becomes more complicated you should use a production level database such as Postgres locally to make sure production behaviors mirrors local behaviors. 

Here are the commands to setup an account with password and superuser rights.

CREATE ROLE [role_name] WITH LOGIN PASSWORD '[password]';
ALTER ROLE [role_name] SUPERUSER;

Friday, April 4, 2014

How To Do The Secret Handshake For Enabling Developer Mode On A Samsung Galaxy S4

To my surprise, enabling developer mode on a Samsung Galaxy S4 is extremely difficult, so difficult even developers such as myself couldn't figure it out. Samsung or Android must be really not trust their users.

Any who, below are the steps to the secret handshake
  1. Go to Settings > About device
  2. Scroll down to Build number
  3. Tap on Build number (a message should appear saying tap 3 more times to enable developer mode).
  4. Tap Build number 3 more times.
There you go developer mode has been enabled. Welcome to the club.

Thursday, April 3, 2014

Android Development Setup Instructions Using Eclipse 4.3.2 Kepler and ADT Plugin

Setting up Eclipse 4.3.2 Kepler for Android development using the ADT plugin is not a smooth process. Below are instructions on how to get it to work. Feel free to share this guide with your other Android developer friends to save them some time.

Step 1

Go to https://www.eclipse.org/downloads/ and download Eclipse Standard. Unpackage the zip folder you download and move it the Applications folder.



Step 2

After starting up Eclipse go to Help > Install New Software. Then an Available Software dialogue box will show up.



Step 3

Click on the Add button and the Add Repository dialogue will show up. For the name enter ADT Plugin and for location enter https://dl.google.com/eclipse/plugin/4.3

After you are done restart Eclipse.




Then you will realize that there are few more configurations that needs to be made. (1) Point to the correct location of Andriod SDK and (2) Update the JRE version to at least 1.7.0.



Step 4

Let's first point Eclipse to the correct location of the Android SDK by clicking on Open Preferences. Next click on the Browse button.


When the Finder opens type into search opt, click on the opt folder that contains the tools folder, and click open.




Step 5

Then a warning dialogue will show up saying the SDK Platform Tools component is missing with the Open SDK Manager button. Click on that button.


When the SDK Manager is open check off Tools and Android 4.4.2 (or the latest version) and click the Install button.

Before proceeding to install, you are prompted to accept all the license agreements for the software you are about to install.



Keep going until you wrap up the Android SDK installation.



Step 6

Now let's update the computer's JRE by going to Oracle's website.

Click on Download Java Platform (JDK) 8, accept any license agreement, unpackage the download, and run the installer.





There you are! You have finally finish installing the Android Development Tools (ADT) plugin for Eclipse 4.3.2 Kepler and you could finally start programming your Android app!



Friday, June 25, 2010

Xbox 360 Kinetic - Microsoft's Revolutionizing Moment

Microsoft recently released Kinetic (code name: Project Natal), which allows Xbox users to use their entire body as a game controller. To illustrate what I am talking about see the video below. How we play games has now been redefined.
Business Review:
Xbox in general was a great move on Microsoft's part. They own majority of the gaming contracts for computer games, so why not make a game console out of it. With Kinectthough they have changed the standard of how people play games, which makes other game consoles, such as PlayStation 3 and Nintendo Wii look ancient. If other game consoles cannot come out with this interactive gaming interface by Christmas, Microsoft will dominate gaming. This also helps Microsoft improve their reputation as a innovation company washing away the fact that they stole Apple's ideas in the past. Steve Jobs always makes fun of Microsoft as lacking innovation and style. I think that ends today with the release of Kinect.


Future Speculation:
As we all know Microsoft is also a software company that makes the operating system that most of us use. With Kinnect, I bet they are also planning to implement a similar functionality utilizing the computer's webcam for a gesture interface, so I think they will also dominate the operating system market in the future as well.

Apple is well aware of this and is probably trying to come out with a similar gesture interface to compete. In fact, it would also make sense for Apple to team up with Sony orNintendo to create this new interface. It would be time and cost efficient, but knowing Apple they just might do it themselves.

I guess in the future (a few years from now) be prepared for a gesture interface like what we saw in Minority Report, Star Trek, and many other sci-fi movies.

Minority Report: Hand Gesture Interface

Nintendo 3DS - thanks for getting rid for the funky glasses

Nintendo has been an innovator in the gaming industry and the launch of the Nintendo 3DS is a testament to their leadership in the gaming market. The Nintendo 3DS is the next generation of the Nintendo DS portable gaming device. As indicated by their clever naming scheme the Nintendo 3DS will have 3D display, but their 3D display methodology will require no funky glasses at all. The only downside is the small screen that a DS has. However it is still cool, so watch out next year the 3Ds will be released!



Nintendo 3DS


Business Review:
Nintendo is very strategic. By releasing a 3D portable device (3DS) they are the first to enter into the 3D gaming market while gaining the association as the 3D gaming company. The 3DS will create a lot of commotion for some time and people will be expecting future game consoles to be 3D capable. Nintendo is also aware that their are many 3D capable monitor that do not require a glass (check out CES), so with the commotion and expectation for 3D, Nintendo could also be the first to develop 3D games because they already have the 3DS framework. By having the 3D association and framework, Nintendo would also have a chance to dominate the gaming market beyond the family, fitness, and classic Nintendo game genres in 3D. Great job Nintendo for being an innovator and getting rid of those annoying glasses.


Size (when closed):
Approximately 5.3 inches wide, 2.9 inches long, 0.8 inches tall.
Weight:
Approximately 8 ounces.
Look:
Final design is TBA.
Top Screen:
3.53-inch widescreen LCD display, enabling 3D view without the need for special glasses; with 800x240 pixel resolution (400 pixels are allocated for each eye to enable 3D viewing).
Touch Screen:
3.02-inch LCD with 320x240 pixel resolution with a touch screen.
Cameras:
One inner camera and two outer cameras with 640x480 (0.3 Mega) pixel resolution.
Pre-Installed Software:
TBA
Nintendo 3DS Game Card:
2 GB Max. at launch.
Wireless Communication:
Can communicate in the 2.4 GHz band. Multiple Nintendo 3DS systems can connect via a local wireless connection to let users communicate or enjoy competitive game play. Systems also can connect to LAN access points to access the Internet and allow people to enjoy games with others. Will support IEEE 802.11 with enhanced security (WPA/WPA2). Nintendo 3DS hardware is designed so that even when not in use, it can automatically exchange data with other Nintendo 3DS systems or receive data via the Internet while in sleep mode.

Game Controls:
Touch screen, embedded microphone, A/B/X/Y face buttons, + Control Pad, L/R buttons, Start and Select buttons, "Slide Pad" that allows 360-degree analog input, one inner camera, two outer cameras, motion sensor and a gyro sensor.

Other Input Controls:
3D Depth Slider to adjust level of 3D effect (can be scaled back or turned off completely depending on the preference of the user), Home button to call system function, Wireless switch to turn off wireless communications (even during game play), Power button. The telescoping stylus is approximately 4 inches when fully extended.

Input/Output:
A port that accepts both Nintendo 3DS game cards and game cards for the Nintendo DS™ family of systems, an SD memory card slot, an AC adapter connector, a charging cradle terminal and a stereo headphone output jack.

Sound:
Stereo speakers positioned to the left and right of the top screen.

Battery:
Lithium ion battery details TBA.

Languages:
TBA

Parental Controls:
Parental controls similar to the Nintendo DSi system will be included.


Here is a sneak preview of the 3DS

YouTube Video


Here is a video of 3D monitors/televisions that don't require the glasses

YouTube Video