|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.eightmotions.util.UtilMidp
public class UtilMidp
Utility classes designed to manage some of the differences between MIDP1.0 and 2.0, and a random set of usefull function....
| Field Summary | |
|---|---|
static boolean |
DEBUG
Set to TRUE to enable more debugging information |
static java.lang.StringBuffer |
debugInfo
A stringBuffer that contains some debugging information |
static boolean |
isCLDC11
True if handset is CLDC1.1 or later |
static boolean |
isMIDP2
True is handset is MIDP2.0 (which should be the only case in this version) |
static boolean |
m_bluetoothEnabled
True is handset haves JSR82 (Bluetooth) capacities |
static javax.microedition.lcdui.Display |
m_display
Reference to the current display (used to display alerts) |
static boolean |
m_isFileAPIEnabled
TRUE is handset haves JSR75 File API |
static boolean |
m_locationAware
True is handset is JSR179 enabled |
static javax.microedition.midlet.MIDlet |
m_midlet
Reference to the main midlet |
static boolean |
m_obexEnabled
True if handset is able to do OBEX/Bluetooth (part of JSR82, but not mandatory) |
static javax.microedition.lcdui.Font |
m_smallFont
A reference to a small font |
static boolean |
m_useOldFormImage
Use MIDP1.0 method for creating images....Useless now |
static java.lang.String |
urlServices
|
| Constructor Summary | |
|---|---|
UtilMidp()
|
|
| Method Summary | |
|---|---|
static void |
addDebug(java.lang.String text)
|
static void |
addInfo(java.lang.String text)
add information to the debug output |
static boolean |
checkAvail(java.lang.String inClassName)
check the avilability of a certain class. |
static boolean |
checkMIDP(javax.microedition.midlet.MIDlet inMidlet)
Initiaisation function, that must be called before calling MapCanvas! |
static boolean |
checkProp(java.lang.String inPropName)
Check the presence of a property in the handset. |
static java.lang.String |
checkString(java.lang.String inDesc)
set description and remove html tags if any |
static java.lang.String |
decode_entities(java.lang.String inString)
|
static java.lang.String[] |
explode(java.lang.String theString)
utility function convert a string into an array of string, '!' |
static java.lang.String[] |
explode(java.lang.String theString,
char separator)
utility function convert a string into an array of string, |
static java.lang.String |
getImgUrl(java.lang.String inDesc)
|
static javax.microedition.lcdui.Image |
getThumbnail(javax.microedition.lcdui.Graphics g,
int inx,
int iny,
javax.microedition.lcdui.Image inIma,
int width)
|
static javax.microedition.lcdui.Image |
getThumbnail(javax.microedition.lcdui.Graphics g,
int inx,
int iny,
javax.microedition.lcdui.Image inIma,
int width,
boolean processAlpha)
Return a thumbnail of in image. |
static java.util.Hashtable |
getUrlParams(java.lang.String request)
Return an array containg the value pair of paramters commands. |
static javax.microedition.lcdui.Image |
ImagecreateImage(java.io.InputStream is)
"safe" way to create image, either using MIDP2.0 form directly from input streal or more manually in MIDP1.0 |
static java.lang.String |
implode(javax.microedition.lcdui.ChoiceGroup cg,
java.lang.String currentSel)
concatenate strings into a a single string |
static boolean |
isRIM()
Return true if we are running on a blackberry platform (based of the "platform" property )... |
static void |
MsgBox(java.lang.String name,
java.lang.String text,
javax.microedition.lcdui.AlertType type,
int time)
Utility function to create and display an alert |
static float |
parseFloat(java.lang.String inString)
|
static boolean |
platformRequest(java.lang.String url)
|
static void |
setDebug(boolean mode)
|
static void |
setIndicator(javax.microedition.lcdui.Alert a,
javax.microedition.lcdui.Gauge g)
Manage MIDP2.0 jauge, but as there is a bug in Backberry, this function is disabled for Blackberry only |
static void |
showException(java.lang.Exception e)
Show a MsgBox with the content of an exception.... |
static java.lang.String |
strReplace(java.lang.String inString,
java.lang.String inPattern,
float infloat)
Same but with floats |
static java.lang.String |
strReplace(java.lang.String inString,
java.lang.String inPattern,
int inVal)
Replace a pattern of a string with an int value for instance, strReplace("I will do the rep","rep",100) will produce: "I will do the 100" |
static java.lang.String |
strReplace(java.lang.String inString,
java.lang.String inPattern,
java.lang.String inVal)
Replace the content of a pattern present in a string by another one. |
static java.lang.String |
toString(double f)
|
static java.lang.String |
toString(float f)
String representation of a float |
static void |
updateGauge(javax.microedition.lcdui.Gauge inGauge)
|
static java.lang.String |
urlEncode(java.lang.String inUrl)
URL encoding Will replace specific characters with their ascii form.. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.String urlServices
public static boolean m_useOldFormImage
public static boolean DEBUG
public static boolean isMIDP2
public static boolean isCLDC11
public static java.lang.StringBuffer debugInfo
public static boolean m_locationAware
public static boolean m_bluetoothEnabled
public static boolean m_obexEnabled
public static boolean m_isFileAPIEnabled
public static javax.microedition.lcdui.Display m_display
public static javax.microedition.lcdui.Font m_smallFont
public static javax.microedition.midlet.MIDlet m_midlet
| Constructor Detail |
|---|
public UtilMidp()
| Method Detail |
|---|
public static void setDebug(boolean mode)
public static boolean checkAvail(java.lang.String inClassName)
inClassName - Name of the classe to check. Return true if the class is present in the handset
public static boolean checkProp(java.lang.String inPropName)
inPropName -
public static void MsgBox(java.lang.String name,
java.lang.String text,
javax.microedition.lcdui.AlertType type,
int time)
name - text - type - time - public static boolean checkMIDP(javax.microedition.midlet.MIDlet inMidlet)
public static boolean isRIM()
public static void addDebug(java.lang.String text)
public static void addInfo(java.lang.String text)
public static javax.microedition.lcdui.Image ImagecreateImage(java.io.InputStream is)
public static void setIndicator(javax.microedition.lcdui.Alert a,
javax.microedition.lcdui.Gauge g)
public static void updateGauge(javax.microedition.lcdui.Gauge inGauge)
updateGaugepublic static java.lang.String[] explode(java.lang.String theString)
theString -
public static java.lang.String[] explode(java.lang.String theString,
char separator)
theString -
public static java.lang.String implode(javax.microedition.lcdui.ChoiceGroup cg,
java.lang.String currentSel)
cg - currentSel -
explodepublic static void showException(java.lang.Exception e)
e -
public static boolean platformRequest(java.lang.String url)
throws javax.microedition.io.ConnectionNotFoundException
url -
javax.microedition.io.ConnectionNotFoundException
public static javax.microedition.lcdui.Image getThumbnail(javax.microedition.lcdui.Graphics g,
int inx,
int iny,
javax.microedition.lcdui.Image inIma,
int width)
public static javax.microedition.lcdui.Image getThumbnail(javax.microedition.lcdui.Graphics g,
int inx,
int iny,
javax.microedition.lcdui.Image inIma,
int width,
boolean processAlpha)
g - inx - iny - inIma - width -
public static java.lang.String urlEncode(java.lang.String inUrl)
public static java.lang.String toString(float f)
public static java.lang.String toString(double f)
public static java.lang.String strReplace(java.lang.String inString,
java.lang.String inPattern,
int inVal)
inString - inPattern - inVal -
public static java.lang.String strReplace(java.lang.String inString,
java.lang.String inPattern,
java.lang.String inVal)
inString - inPattern - inVal -
public static java.lang.String strReplace(java.lang.String inString,
java.lang.String inPattern,
float infloat)
inString - inPattern - infloat -
public static java.lang.String decode_entities(java.lang.String inString)
public static java.lang.String checkString(java.lang.String inDesc)
public static java.lang.String getImgUrl(java.lang.String inDesc)
public static java.util.Hashtable getUrlParams(java.lang.String request)
public static float parseFloat(java.lang.String inString)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||