Created
February 12, 2014 21:00
-
-
Save ChrisMwai/8964400 to your computer and use it in GitHub Desktop.
Simplest way to get contacts in s40(J2ME) with LWUIT.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.exqitsolutions.numberTest; | |
/* | |
*@author Chris | |
*/ | |
import com.sun.lwuit.Form; | |
import com.sun.lwuit.layouts.BorderLayout; | |
import com.sun.lwuit.TextField; | |
//include the other nescessary packages | |
public class Field extends MIDlet{ | |
public Form numForm; | |
public TextField num; | |
public void startApp(){ | |
//initialize display, theme and other optional packages | |
//AnimatedGifFactory falls here | |
ReadContacts(); | |
} | |
public void ReadContacts(){ | |
numForm = new Form("Get Contacts"); | |
numForm.setLayout(new BorderLayout()); | |
num = new TextField(); | |
num.setConstraint(TextField.PHONENUMBER);//this is so important!! | |
num.setHint("Number"); | |
numForm.addComponent(BorderLayout.CENTER, num); | |
numForm.show(); | |
} | |
public void pauseApp(){ | |
} | |
public void destroyApp(boolean unconditional){ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Explanation(not nescessary though, but still
...):
Simple!!!
NB: This is a second gist, couldn't delete the first one. There might be an error or two up there, I typed this on my phone.