Java

Send SMS Using Twilio REST API from App Engine Java

  • Posted on: 3 May 2014
  • By: oon

Do you need to send short message (SMS) from cloud? it's so easy using Twilio.

I have tried to send SMS (and call) using Twilio from my App Engine Java web application. This example using URLFetchService because some of the API use HTTPS.

here's the snippet to send SMS using Twilio REST API [1] instead of using Twilio-java helper library [2].

Using Velocity as Template Engine for Web based on App Engine

  • Posted on: 14 April 2014
  • By: oon

Udah pernah buat aplikasi web? Mungkin sudah pernah juga menggunakan pendekatan MVC (model view controller).

Dalam pemrograman aplikasi web menggunakan Java, kadang orang memilih bagian View menggunakan JSP. Dalam artikel ini akan dibahas alternative mekanisme Template untuk View menggunakan Apache Velocity[1].

App Engine Java Write Log

  • Posted on: 2 April 2014
  • By: oon

if you want to check your app output via Log from App Engine Java in Developer Console, you can use java.util.logging.Logger:


private static final Logger log = Logger.getLogger(MyClass.class.getName());
public void someMethod() {
log.info("An informational message.");

log.warning("A warning message.");

log.severe("An error message.");
}

GSON Convert ArrayList to JSON with Custom Object (POJO)

  • Posted on: 20 January 2014
  • By: oon

I have a POJO (Plain Old Java Object), a custom object for storing Latitude and Longitude:


public class Point {
public String lat;
public String lon;
public Point(String lat, String lon) {
this.lat=lat;
this.lon=lon;
}
}

Now how to convert ArrayList<Point> to JSON and convert it back using GSON Library:


public class JConverter {

Upgrade Apache Maven on Mac OSX

  • Posted on: 18 December 2013
  • By: oon

I use maven 3.0.3 on my Mac OSX 10.8.5.

o:~ oonarfiandwi$ mvn -version
Apache Maven 3.0.3 (r1075438; 2011-03-01 00:31:09+0700)
Maven home: /usr/share/maven
Java version: 1.7.0_45, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.8.5", arch: "x86_64", family: "mac"

Then some apps need maven 3.2.1.

Tags: 

Run Eclipse on Mac with Java 7 got Warning to Install Java SE 6

  • Posted on: 24 October 2013
  • By: oon
Eclipse.app require Java SE 6

Suatu saat penulis menginstall hanya Java 7 di Mac OS Mavericks 10.9, kemudian saat menjalan Eclipse (saat percobaan ini, versi eclipse adt bundle), kemudian muncul pop-up seperti pada gambar. Salah satu cara singkat penyelesainnya (iya, buat sebagian orang ini adalah jalan pintas tapi bukan jalan yang benar) adalah: 

sudo vim /Library/Java/JavaVirtualMachines/jdk1.7.0_xx/Contents/Info.plist

(anda akan ditanya password untuk meminta hak akses menjadi super user)

Gantikan baris-baris berikut:

Tags: 

Pages