Tuesday, May 27, 2014

Ti SensorTag now supports iBeacon!

Good news! The Ti SensorTag is now also an iBeacon! With a firmware update, you can now enable your Ti SensorTag to act as an iBeacon. Come and attend out Bluetooth Low Energy course on the date below and get a Ti SensorTag when you sign up!

18 June 2014
S$699/pax

Sunday, May 25, 2014

Change in course schedule in June 2014

Please note the changes in course schedule in June 2014.

June 2014
Sun
Mon
Tue
Wed
Thu
Fri
Sat
1

2
3
4
5
6
7
8

9
10
11
12
13
14
15

16-17
S$1,295/pax
18
S$699/pax
19-20
S$1097/pax

[Date updated]
21-22
S$1,195/pax
NEW
21-22
S$1,195/pax
NEW
23
 24
S$699/pax
NEW
[Date updated]
25-26
S$1097/pax


[Date updated]
27
S$699/pax
NEW
[Date updated]
 28
29

30





Friday, May 23, 2014

Validating and formatting JSON strings

If your apps deal with JSON strings, you will need a good tool to let you verify and understand the structure of the JSON string easily. Head over to http://jsonlint.com, the JSON Validator:


Paste your JSON string into the text box and it will format your JSON string in a human-readable format.

You are most welcome. :-)

Tuesday, May 20, 2014

Foundation of Android Programming - 25-26 June 2014

Android is continuing its unstoppable path to dominating the smartphone market. If you have always wondered how to write apps on Android, this is the best time! Come and join us in the Foundation of Android Programming class on the 25-26 June 2014 and I will show you how to write killer apps on the Android platform.

For registration, download the course outline and application form here.

P.S. You need to have some programming knowledge (such as Java or C) in order to get the most out of this course. 

Wednesday, May 14, 2014

Pebble Programming course on 16-17 June 2014 is now confirmed


Come and learn how to write cool apps for your Pebble watch and see how your apps can communicate with your smartphone to access Web services, and more!

The course fee of S$1,295 includes a Pebble watch that you can bring home after the course. For registration, download the course outline and application form here. 

Tuesday, April 29, 2014

Android Tip - Displaying App Icons

You often need to display icons in your Android apps. Instead of designing your own, the Android system comes with a set of icons that you can use in your application.

The application icons that come bundled with Android is accessible through the android.R.drawable class.  For example, if you want to display a Share icon on your ImageButton, you simple use the setImageResource() method of the view, like this:

        btnShare = (ImageButton) findViewById(R.id.btnShare);
        btnShare.setImageResource(
            android.R.drawable.ic_menu_share);

The following code snippet shows how you can use Reflection to go through the list of constants defined in the android.R.drawable class and display each icon:

package net.learn2develop.appicons.appicons;

import android.graphics.Color;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;

import java.lang.reflect.Field;

public class MainActivity extends ActionBarActivity {

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

        //---display all the icons defined in
        // android.R.drawable---
        DisplayDrawables(android.R.drawable.class);
    }

    //---use reflection to examine the fields in a class---
    public void DisplayDrawables(Class _class){
        LinearLayout linearLayout = (LinearLayout)
            findViewById(R.id.linearLayout);
        LinearLayout.LayoutParams lp = new
            LinearLayout.LayoutParams(
                LinearLayout.LayoutParams.WRAP_CONTENT,
                LinearLayout.LayoutParams.WRAP_CONTENT);

        final Field[] fields = _class.getDeclaredFields();
        for (Field field : fields) {
            final int drawableId;
            try {
                drawableId = field.getInt(_class);
                ImageButton imageButton = new
                    ImageButton(this);
                imageButton.setImageResource(drawableId);
                imageButton.setLayoutParams(lp);
                imageButton.setBackgroundColor(
                    Color.TRANSPARENT);
                linearLayout.addView(imageButton);

                TextView txtView = new TextView(this);
                txtView.setText(field.getName());
                imageButton.setLayoutParams(lp);
                imageButton.setBackgroundColor(
                    Color.TRANSPARENT);
                linearLayout.addView(txtView);
            } catch (Exception e) {
                continue;
            }
        }
    }

In the activity_main.xml, you use a ScrollView to contain a LinearLayout:

<ScrollView xmlns:android=
    "http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <LinearLayout
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/linearLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:paddingLeft=
            "@dimen/activity_horizontal_margin"
        android:paddingRight=
            "@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin"
        android:paddingBottom=
            "@dimen/activity_vertical_margin"
        android:orientation="vertical"
        tools:context=
           "net.learn2develop.appicons.appicons.MainActivity">
    </LinearLayout>

</ScrollView>

The following screenshot shows the application icons and their corresponding names:

 


Monday, April 28, 2014

Developing Android UI - 26 June 2014

Want to create professional looking Android UI? Come join our Advanced Android - Developing Android UI course on the 26 June 2014 and you will learn how to build nice-looking Android UI. Among the topics you will learn is how to build an image gallery viewer where you can download files from the Web onto your device and view it on your device. You will also learn how to access your DropBox account and download pictures onto your devices!

Note: This course will use Android Studio.

Venue
Bayview Hotel

Fee
S$699 (nett; no GST)
Includes a lunch and 2 tea-breaks

Time
9am to 5pm

Prerequisites
Basic knowledge of Android Programming

Sunday, April 20, 2014

Courses in June 2014

Please note that the following courses have changes in schedules (http://weimenglee.blogspot.no/2014/05/change-in-course-schedule-in-june-2014.html):

Sunday, April 13, 2014

Learn how to program iBeacons in your Android and iOS apps - CODE Magazine May/June 2014 issue

My article on iBeacon is the cover story for the May/June issue of CODE Magazine! Grab a copy or if you prefer, read the online version here. 
"One of the buzzwords you hear often is Bluetooth LE, short for Bluetooth Low Energy. Bluetooth LE is a wireless personal area network technology like its previous incarnation, Classic Bluetooth. Most people are familiar with Classic Bluetooth: You pair your Bluetooth headset with your mobile phone and use it to answer your calls, etc.
However, using Bluetooth Low Energy, you don’t necessarily have to pair with a device in order to perform useful work. A number of health-related medical devices, such as the Heart Rate Monitor and Blood Pressure Monitor, allow your mobile device to connect to them and receive vital information about your health. One very cool use of Bluetooth LE is Apple’s iBeacon. Using an iBeacon, a device can detect the presence of an iBeacon and use that information to provide locale-specific functions, such as merchandise promotion, payment information, etc.
In this article, you will learn the basics of Bluetooth LE and explore the world of iBeacons. You will see how you can write iOS and Android apps that use iBeacons to provide location-based services"

Saturday, April 12, 2014

List of Courses for June 2014

I am pleased to launch a couple of new courses this coming June. Check out the list below and more details will be released in the coming days:

16-17 June 2014 (Mon-Tue) - PEB101 - Foundation of Pebble Programming - $1,295

18 June 2014 (Wed) - AND303 - Advanced Android - Bluetooth Low Energy Programming - $699

19-20 June 2014 (Thu-Fri) - IOS101 - Foundation of iPhone 
Programming - $1,097


21-22 June 2014 (Sat-Sun) - AND001 - Developing Android Applications using App Inventor - $1,195

24 June 2014 (Tue) - AND305 - Advanced Android - Developing Android User Interfaces - $699

25-26 June 2014 (Wed-Thu) - AND101 - Foundation of Android 
Programming - $1,097

27 June 2014 (Fri) - AND304 - Advanced Android - Android Wear Programming  - $699

Venue
Bayview Hotel Singapore
30 Bencoolen Street
Singapore 189621
9am to 5pm

Thursday, April 10, 2014

Speaking at NDC Oslo on Pebble and Android Wear!


For the upcoming Norwegian Developers Conference (NDC) in Oslo, Norway (2-6 June 2014), my theme is on one key area - Wearable Computing Programming.

Here are the talks that I will be giving:

Programming Pebble
Say Hello to your Google Android Wear Watch

If you are in the area, be sure to say hi!

Wednesday, April 09, 2014

Foundation of iPhone Programming on the 14-15 April is now confirmed!



The Foundation of iPhone Programming course on the 14-15 April is now confirmed! If you have always wanted to learn how to program your iPhone and iPad, come join us! For registration, email weimenglee@learn2develop.net. See you at the course!

Monday, March 31, 2014

Android Tip - Intercepting Links on Browsers

Have you ever encountered this situation where you click on a YouTube link on the browser on your Android device and you are prompted to view the video either using the YouTube app or on the browser? How do you make your app respond to a particular type of links on the browser?

You do so, you just need to add in the necessary intent filter to your app’s AndroidManifest.xml file. The following code snippets shows how your app can be launched when the user taps on a link that points to http://learn2develop.net/2014:

        <intent-filter>
            <action android:name=
                "android.intent.action.VIEW" />
            <category android:name=
                "android.intent.category.DEFAULT" />
            <category android:name=
                "android.intent.category.BROWSABLE" />
               
            <data android:scheme="http"
                  android:host="learn2develop.net"
                  android:pathPrefix="/2014" />
        </intent-filter>          

In your activity, you can retrieve the URL that the user has tapped using the getDataString() method of the Intent object:

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
       
        Intent i = getIntent();            
        Toast.makeText(this, i.getAction(),
            Toast.LENGTH_LONG).show();       
        Toast.makeText(this, i.getDataString(),
            Toast.LENGTH_LONG).show();           
    }

The following URLs will trigger your app:



But the following URLs won’t:
·       http://www.amazon.com