package a.uilibrary;
import net.rim.device.api.system.Bitmap;
import net.rim.device.api.system.Display;
import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.DrawStyle;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.Font;
import net.rim.device.api.ui.FontFamily;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.XYEdges;
import net.rim.device.api.ui.XYRect;
import net.rim.device.api.ui.component.ObjectChoiceField;
import net.rim.device.api.ui.decor.BorderFactory;
public class CustomChoiceField extends ObjectChoiceField
{
public static final int TEXT_HALINGMENT_CENTER = 1;
String[] m_Choices;
private int m_MarginLeft = 1;
private int m_PaddingTop = 1+1;
private int m_PaddingBottom = 1;
private int m_MarginTop = 1;
private int m_currentheight = 1;
private int m_ChoiceFieldWidth;
private int m_Height;
private boolean m_isFocused = false;
private Font font;
private FontFamily fontFamily[]=FontFamily.getFontFamilies();
String label1;
public CustomChoiceField(String label, String[] choices, int initialIndex, long style)
{
super(label, choices, initialIndex,Field.FOCUSABLE|DrawStyle.ELLIPSIS|Field.USE_ALL_WIDTH);
label1=label;
m_Choices = choices;
font=fontFamily[0].getFont(FontFamily.CBTF_FONT, 12).derive(Font.BOLD);
Font currFont = font;
m_Height = currFont.getHeight();
m_ChoiceFieldWidth =Display.getWidth();
m_currentheight=font.getHeight()*3;
}
public void setChoices(Object[] choices)
{
super.setChoices(choices);
m_Choices = (String[])choices;
}
public int getPreferredWidth()
{
return (Display.getWidth()-4);
}
public int getPreferredHeight()
{
return m_currentheight;
}
public boolean isFocusable()
{
return true;
}
public void getFocusRect(XYRect rect)
{
rect.set(m_MarginLeft + getFont().getAdvance(getLabel()), m_MarginTop , m_ChoiceFieldWidth, m_Height + m_PaddingBottom + m_PaddingTop+6);
}
protected void layout(int width, int height)
{
setExtent(getPreferredWidth(),getPreferredHeight());
}
protected void drawFocus(Graphics graphics, boolean on)
{
invalidate();
}
public void onFocus(int direction)
{
m_isFocused = true;
invalidate();
}
public void onUnfocus()
{
m_isFocused = false;
invalidate();
}
protected void paintBackground(Graphics g)
{
if(m_isFocused==true)
{
// 076cc7 to 7ac1ff
int[] drawColors = {
0x1a66b4 , 0x1a66b4, 0x1a66b4, 0x1a66b4, 0x1a66b4, 0x1a66b4,
0x4b80b7, 0x4b80b7, 0x4b80b7, 0x4b80b7, 0x4b80b7, 0x4b80b7 };
g=Gradient.draw(g,(m_currentheight),Display.getWidth(),drawColors);
}
else
{
int[] drawColors = {
0xf5f5f5, 0xf5f5f5, 0xf5f5f5, 0xf5f5f5, 0xf5f5f5, 0xf5f5f5,
0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd, 0xbdbdbd };
g=Gradient.draw(g,(m_currentheight),Display.getWidth(),drawColors);
}
// super.paint(g);
}
public void paint(Graphics g)
{
String longString = (getSelectedIndex() == -1 || getSelectedIndex() >= m_Choices.length)?"":m_Choices[getSelectedIndex()];
int textY = m_MarginTop + m_PaddingTop + (m_Height -font.getHeight())/2;
if(textY < 0)
textY = m_MarginTop;
String firstLine = "";
String secondLine = "";
boolean isSecondLine = false;
int charWidth,spaceIndex=0,totalWidth=0,lastIndex = 0;
for (int i = 0; i < longString.length(); i++)
{
charWidth = Font.getDefault().getAdvance(String.valueOf(longString.charAt(i)));
if(longString.charAt(i) == ' ')
{
spaceIndex = i;
}
if((charWidth + totalWidth) > (Display.getWidth()))
{
isSecondLine=true;
firstLine = longString.substring(0, spaceIndex);
i = spaceIndex + 1;
lastIndex = i;
secondLine=longString.substring(lastIndex, longString.length());
charWidth = 0;
totalWidth = 0;
}
totalWidth += charWidth;
}
Bitmap b=Bitmap.getBitmapResource("down.png");
int x=(Display.getWidth()-b.getWidth()-(b.getWidth()/2));
int y=m_currentheight-(m_currentheight/2)-((m_currentheight/2)/2);
int temph;
if(m_isFocused==true)
{
g.setColor(Color.WHITE);
this.setFont(Font.getDefault().derive(Font.PLAIN|Font.EMBOSSED_EFFECT,Font.getDefault().getHeight()-4));
if(isSecondLine)
{
m_currentheight=font.getHeight()*6;
temph=(m_currentheight/2)/2;
g.drawText(firstLine, 4, temph,0,Display.getWidth()-10);
g.drawText(secondLine, 4, (temph+font.getHeight()+7),0,Display.getWidth()-10);
this.setBorder(BorderFactory.createBevelBorder(new XYEdges(2,2,2,2)));
}
else
{
m_currentheight=font.getHeight()*3;
temph=(m_currentheight/2)/2;
g.drawText(longString, 4, temph,0,Display.getWidth()-10);
this.setBorder(BorderFactory.createBevelBorder(new XYEdges(2,2,2,2)));
}
}
else
{
this.setFont(Font.getDefault().derive(Font.PLAIN|Font.EMBOSSED_EFFECT,Font.getDefault().getHeight()-4));
//g.drawBitmap(0, m_MarginTop-1,Display.getWidth() , image.getHeight()+2,image,0,0);
if(isSecondLine)
{
m_currentheight=font.getHeight()*6;
temph=(m_currentheight/2)/2;
g.drawText(firstLine, 4, temph,0,Display.getWidth()-10);
g.drawText(secondLine, 4, (temph+font.getHeight()+7),0,Display.getWidth()-10);
this.setBorder(BorderFactory.createBevelBorder(new XYEdges(2,2,2,2)));
}
else
{
m_currentheight=font.getHeight()*3;
temph=(m_currentheight/2)/2;
g.drawText(longString, 4, temph,0,Display.getWidth()-10);
this.setBorder(BorderFactory.createBevelBorder(new XYEdges(2,2,2,2)));
}
}
g.drawBitmap(x, y, b.getWidth(),m_currentheight+2 , b, 0, 0);
}
}
Images USed:
Gradient Class Can Be Found on the same blog as "Blackberry Gradient Fill Field Or Manager" in same "Blackberry Library, " category
Friday, January 20, 2012
Blackberry Custom ObjectChoiceField
Wednesday, January 18, 2012
Tooltip For Field
1. Class For Tooltip is
package a.uilibrary;
import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Font;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.Manager;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.XYEdges;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.container.PopupScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;
import net.rim.device.api.ui.decor.BorderFactory;
class MyTooltip extends PopupScreen{
int _x;
int _y;
TooltipThread _tooltipThread;
private MyTooltip(Manager manager) {
super(manager);
}
public void sublayout(int width, int height) {
super.sublayout(width,height);
setPosition(_x,_y);
System.out.println("Tooltip x: " + Integer.toString(_x) + ", y: " + Integer.toString(_y));
}
protected void applyTheme() {
// Overriden to suppress Border etc.
}
public void removeToolTip() {
if ( _tooltipThread != null ) {
_tooltipThread.dismiss();
}
}
private void display(UiApplication uiApp, int x, int y, int displayTime) {
_x = x;
_y = y;
_tooltipThread = new TooltipThread(uiApp, this, displayTime);
_tooltipThread.start();
}
public static MyTooltip addToolTip(UiApplication uiApp, String toolTipString, int x, int y, int displayTime) {
VerticalFieldManager manager = new VerticalFieldManager(Manager.FIELD_VCENTER|Manager.NON_FOCUSABLE) {
protected void paint(Graphics graphics) {
//graphics.setColor(0x00FFFFFF); // White
//graphics.fillRect(0,0,getWidth(),getHeight());
graphics.setColor(0x00000000); // Black
// graphics.drawRect(0,0,getWidth(),getHeight());
super.paint(graphics);
}
};
MyTooltip toolTip = new MyTooltip(manager);
LabelField label = new LabelField(' ' + toolTipString + ' ', LabelField.NON_FOCUSABLE);
label.setBorder(BorderFactory.createBitmapBorder(new XYEdges(5,5,5,5),Bitmap.getBitmapResource("bubble_left.png")));
label.setFont(Font.getDefault().derive(Font.PLAIN, 16));
toolTip.add(label);
toolTip.display(uiApp, x, y, displayTime);
return toolTip;
}
class TooltipThread extends Thread {
Object _notifyObject = new Object(); // Used to allow user to dismiss this Tooltip
PopupScreen _tooltip; // Screen we are going to display
UiApplication _ourApplication; // access to pushGlobalScreen and dismissStatus from our Application
int _displayTime; // in seconds
public TooltipThread(UiApplication ourApplication, PopupScreen tooltip, int displayTime) {
_tooltip = tooltip;
_ourApplication = ourApplication;
_displayTime = displayTime;
}
public void run() {
_ourApplication.pushGlobalScreen(_tooltip, 999, false);
synchronized(_notifyObject) {
try {
_notifyObject.wait(_displayTime * 1000);
} catch (Exception e) {
}
};
_ourApplication.dismissStatus(_tooltip);
}
public void dismiss() {
// notify the waiting object to stop the Thread waiting
synchronized(_notifyObject) {
_notifyObject.notify();
}
}
}
}
2 Using this class Example add this as fields onFocus & onUnfocus method
protected void onFocus(int direction)
{
invalidate();
if(this.getText().equalsIgnoreCase(promot))
{
this.setText("");
if ( _tooltip != null )
{
_tooltip.removeToolTip();
_tooltip = null;
}
contentArea = this.getContentRect();
contentBottom = contentArea.y + contentArea.height-5;
contentRight = contentArea.x + contentArea.width;
contentBottom = contentBottom - this.getManager().getVerticalScroll();
if (!(contentBottom > (getHeight() - 10)))
{
contentBottom =contentBottom - getHeight()-2;
}
_tooltip = MyTooltip.addToolTip(UiApplication.getUiApplication(), promot, 20, contentBottom,2);
flag=false;
invalidate();
}
super.onFocus(direction);
}
protected void onUnfocus()
{
// remove tooltip
if ( _tooltip != null ) {
// We have displayed a Tooltip - remove it
_tooltip.removeToolTip();
_tooltip = null;
}
invalidate();
super.onUnfocus();
}
Tuesday, January 10, 2012
Using KSOAP Blackberry
1. Download KSOAP Blackberry Source code from
Download HERE
2. Extract that zip and copy "org" folder to your current project source
3. Code For Connecting to Webservice is
2. Extract that zip and copy "org" folder to your current project source
3. Code For Connecting to Webservice is
public void obSOAP()
{
// wsdl webservice path dont add "?wsdl" it will give error
String serviceUrl = "http://ganesh.com/~ganesh/webservices/webservices.php";
String serviceNamespace = "http://ganesh.com/ganu/";
// function from webservice "getInvoiceList"
String soapAction = "http://ganesh.com/~ganesh/webservices/webservices.php/getInvoiceList";
/******************************************************************************************************************
Following are the three ways to connect webservice choose appropriate one for this we are using first one
1. For Normal connection use following line
HttpTransport ht=new HttpTransport(serviceUrl);
2. If using basic authentication use following line here Username=test & password=supp0rt
HttpTransportBasicAuth ht = new HttpTransportBasicAuth(serviceUrl,"test","supp0rt");
3. If using on wifi use following for device otherwise it will not run on device
HttpTransportBasicAuth ht = new HttpTransportBasicAuth(serviceUrl+";deviceside=true;interface=wifi","test","supp0rt");
*********************************************************************************************************************************/
HttpTransport ht=new HttpTransport(serviceUrl);
SoapObject rpc = new SoapObject(serviceNamespace,"getInvoiceList");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER10);
// setup the input parameter for the webservice
// parameter to send to webservice function
rpc.addProperty("email","ganesh.pachpind@gmail.com");
rpc.addProperty("password","1234");
envelope.bodyOut = rpc;
envelope.encodingStyle = SoapSerializationEnvelope.ENC;
envelope.setOutputSoapObject(rpc);
try
{
ht.debug = true;
/******************************************************************************************************************
HERE function
ht.requestdumb & ht.responsedumb can be uset to print request and response
********************************************************************************************************************/
ht.call(soapAction, envelope);
Object response = envelope.getResponse();
// this is response from webservice
}
catch(Exception ex)
{
}
}
Using KXML For Xml Parsing
Consider Following XML
Ganesh Pachpind Om Shanti Nagar Mayur Pachpind Om Shanti Nagar
Code for Parsing :
// here XMLSTRING is the response String from webservice which is as above
//Parsing logic
byte[] xmlByteArray = XMLSTRING.getBytes();
ByteArrayInputStream xmlStream = new ByteArrayInputStream( xmlByteArray );
InputStreamReader xmlReader = new InputStreamReader( xmlStream );
// create new parser objet
KXmlParser parser = new KXmlParser();
parser.setInput(xmlReader);
parser.nextTag();
parser.require(XmlPullParser.START_TAG, null, "response");
// main tag is response
while((parser.next()==XmlPullParser.START_TAG)&&(parser.getName().equalsIgnoreCase("error")))
{
if(parser.nextText().equalsIgnoreCase(""))
{
//if error is empty then only it will check for result tag
flag=true;
while((parser.next()==XmlPullParser.START_TAG)&&(parser.getName().equalsIgnoreCase("result")))
{
//resut tag parsing now
// as their exit one more xml structure in result tag we will parse it seperate
byte[] xmlByteArray1 = (parser.nextText()).getBytes();
ByteArrayInputStream xmlStream1 = new ByteArrayInputStream( xmlByteArray1 );
InputStreamReader xmlReader1 = new InputStreamReader( xmlStream1 );
KXmlParser parser1 = new KXmlParser();
parser1.setInput(xmlReader1);
parser1.next();
//DATA tag
parser1.require(XmlPullParser.START_TAG, null, "data");
while ((parser1.nextTag () != XmlPullParser.END_TAG))
{
// this function is give bellow
readXMLData(parser1);
}
parser1.require(XmlPullParser.END_TAG, null, "data");
parser1.next();
parser1.require(XmlPullParser.END_DOCUMENT, null, null);
}// result tag parsing end
}
else
{
//if error tag is not empty do its parsing here
}
}// while error tag end
readXMLData function as follow :
// Read Inner Tags
private void readXMLData(KXmlParser parser)throws Exception
{
// TODO Auto-generated method stub.
parser.require(XmlPullParser.START_TAG, null, "data");
while (parser.nextTag() != XmlPullParser.END_TAG)
{
parser.require(XmlPullParser.START_TAG, null, null);
String name = parser.getName();
String text = parser.nextText();
if (name.equals("fname"))
System.out.println("First Name:"+name.equals("fname"));
else if (name.equals("lname"))
System.out.println("Last Name:"+name.equals("lname"));
else if (name.equals("add"))
System.out.println("Address:"+name.equals("add"));
parser.require(XmlPullParser.END_TAG, null, name);
}
parser.require(XmlPullParser.END_TAG, null, "data");
}
Saturday, January 7, 2012
Align Field in HorizontalFieldManager
Its a bug in blackberry jde, try following:
1. if you want to add only single field in this manager, then create Vertical Field Manager instead of Horizontal Field Manager.
2. If you have two or fields and all of these should be right aligned, then create a VerticalFieldManager(Manager.USE_ALL_WIDTH|Manager.FIELD_RIGHT), create a horizontal field manager add all fields to this horizontal manager, and add horizontal manager to vertical manager
3. if you have more than one field and these should be aligned differently, then please create a horizontal field manager add fields to this manager you want to align left. create a verticalfieldmanager using full width and field_right. create fields in this manager with style Field.RIGHT or Field.HCENTER according to your needs.
1. if you want to add only single field in this manager, then create Vertical Field Manager instead of Horizontal Field Manager.
2. If you have two or fields and all of these should be right aligned, then create a VerticalFieldManager(Manager.USE_ALL_WIDTH|Manager.FIELD_RIGHT), create a horizontal field manager add all fields to this horizontal manager, and add horizontal manager to vertical manager
3. if you have more than one field and these should be aligned differently, then please create a horizontal field manager add fields to this manager you want to align left. create a verticalfieldmanager using full width and field_right. create fields in this manager with style Field.RIGHT or Field.HCENTER according to your needs.
Blacberry Splash Screen
1.Code For Splash Screen is
package mypackage;
import java.util.Timer;
import java.util.TimerTask;
import net.rim.device.api.system.Bitmap;
import net.rim.device.api.system.Display;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.container.MainScreen;
public class SplashScreen extends MainScreen {
Bitmap popup;
SplashScreen screen = this;
private Timer splashTimer = new Timer();
private TimerTask splashTask;
int count = 0;
int screenWidth = Display.getWidth();
int screenHeight = Display.getHeight();
int yCoord;
int xCoord;
boolean showSplash = true;
boolean splashDisplayed = false;
public SplashScreen(Bitmap popup, final int seconds) {
this.popup = popup;
xCoord = (screenWidth - popup.getWidth()) / 2;
yCoord = (screenHeight - popup.getHeight()) / 2;
splashTask = new TimerTask() {
public void run() {
if (showSplash && !splashDisplayed) {
count++;
if (count == seconds * 10) {
showSplash = false;
splashDisplayed = true;
splashTimer.cancel();
invalidate();
}
}
}
};
splashTimer.scheduleAtFixedRate(splashTask, 100, 100);
}
protected void paint(Graphics graphics) {
super.paint(graphics);
if (showSplash && !splashDisplayed) {
graphics.drawBitmap(xCoord, yCoord, popup.getWidth(), popup.getHeight(), popup, 0, 0);
//draw border, delete if not needed:
//graphics.setColor(0xcccccc);
//graphics.drawRect(xCoord, yCoord, popup.getWidth(), popup.getHeight());
}
}
protected void onUiEngineAttached(boolean attached) {
showSplash = true;
invalidate();
super.onUiEngineAttached(attached);
}
//allow user to dismiss splash screen:
protected boolean navigationMovement(int dx, int dy, int status, int time) {
return DismissSplash();
}
protected boolean navigationClick(int status, int time) {
return DismissSplash();
}
protected boolean keyChar(char c, int status, int time) {
return DismissSplash();
}
private boolean DismissSplash() {
if (showSplash) {
showSplash = false;
splashDisplayed = true;
invalidate();
return true;
}else{
return false;
}
}
}
2. In applications Entry point screen extends SplashScreen & call to Super as shown bellow
package mypackage;
import net.rim.device.api.system.Bitmap;
import net.rim.device.api.system.Display;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.FieldChangeListener;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.ButtonField;
/**
* A class extending the MainScreen class, which provides default standard
* behavior for BlackBerry GUI applications.
*/
public final class MyScreen extends SplashScreen
{
/**
* Creates a new MyScreen object
*/
public MyScreen()
{
super(ImageResize.resizeBitmap(Bitmap.getBitmapResource("thepopup.png"), Display.getWidth(), Display.getHeight()), 5);
setTitle("This IS Main First Screen After SplashScreen");
}
}
Friday, January 6, 2012
Field At left ,Right & Center HorizontalField Manager
Manager customManager = new Manager(0)
{
protected void sublayout(int width, int height) {
setPositionChild(
getField(0),
0,
0);
layoutChild(
getField(0),
getField(0).getPreferredWidth(),
getField(0).getPreferredHeight());
setPositionChild(
getField(1),
Graphics.getScreenWidth()/2 - getField(1).getPreferredWidth()/2,
0);
layoutChild(
getField(1),
getField(1).getPreferredWidth(),
getField(1).getPreferredHeight());
setPositionChild(
getField(2),
Graphics.getScreenWidth() - getField(2).getPreferredWidth(),
0);
layoutChild(
getField(2),
getField(2).getPreferredWidth(),
getField(2).getPreferredHeight());
setExtent(width, height);
}
};
customManager.add(new BitmapField(Bitmap.getBitmapResource("image1.png")));
customManager.add(new LabelField("Hello Alignment"));
customManager.add(new BitmapField(Bitmap.getBitmapResource("image2.png")));
Fields on two corners of the screen Horizontally
package mypackage;
import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.Manager;
/**
* Custom class to place the Fields on two corners of the screen Horizontally
*/
public class JustifiedHorizontalFieldManager extends Manager
{
private static final int SYSTEM_STYLE_SHIFT = 32;
public Field _leftField;
public Field _rightField;
private boolean _giveLeftFieldPriority;
public JustifiedHorizontalFieldManager( Field leftField, Field rightField, boolean giveLeftFieldPriority )
{
this( leftField, rightField, giveLeftFieldPriority, Field.USE_ALL_WIDTH );
}
public JustifiedHorizontalFieldManager( Field leftField, Field rightField, boolean giveLeftFieldPriority, long style )
{
super( style );
_leftField = leftField;
_rightField = rightField;
add( _leftField );
add( _rightField );
_giveLeftFieldPriority = giveLeftFieldPriority;
}
public JustifiedHorizontalFieldManager( boolean giveLeftFieldPriority, long style )
{
super( style );
_giveLeftFieldPriority = giveLeftFieldPriority;
}
public void addLeftField( Field field )
{
if( _leftField != null ) {
throw new IllegalStateException();
}
_leftField = field;
add( _leftField );
}
public void addRightField( Field field )
{
if( _rightField != null ) {
throw new IllegalStateException();
}
_rightField = field;
add( _rightField );
}
public int getPreferredWidth()
{
return _leftField.getPreferredWidth() + _rightField.getPreferredWidth();
}
public int getPreferredHeight()
{
return Math.max( _leftField.getPreferredHeight(), _rightField.getPreferredHeight() );
}
protected void sublayout( int width, int height )
{
Field firstField;
Field secondField;
if( _giveLeftFieldPriority ) {
firstField = _leftField;
secondField = _rightField;
} else {
firstField = _rightField;
secondField = _leftField;
}
int maxHeight = 0;
int availableWidth = width;
availableWidth -= _leftField.getMarginLeft();
availableWidth -= Math.max( _leftField.getMarginRight(), _rightField.getMarginLeft() );
availableWidth -= _rightField.getMarginRight();
layoutChild( firstField, availableWidth, height - firstField.getMarginTop() - firstField.getMarginBottom() );
maxHeight = Math.max( maxHeight, firstField.getMarginTop() + firstField.getHeight() + firstField.getMarginBottom() );
availableWidth -= firstField.getWidth();
layoutChild( secondField, availableWidth, height - secondField.getMarginTop() - secondField.getMarginBottom() );
maxHeight = Math.max( maxHeight, secondField.getMarginTop() + secondField.getHeight() + secondField.getMarginBottom() );
availableWidth -= secondField.getWidth();
if( !isStyle( Field.USE_ALL_HEIGHT ) ) {
height = maxHeight;
}
if( !isStyle( Field.USE_ALL_WIDTH ) ) {
width -= availableWidth;
}
setPositionChild( _leftField, _leftField.getMarginLeft(), getFieldY( _leftField, height ) );
setPositionChild( _rightField, width - _rightField.getWidth() - _rightField.getMarginRight(), getFieldY( _rightField, height ) );
setExtent( width, height );
}
private int getFieldY( Field field, int height )
{
switch( (int)( ( field.getStyle() & FIELD_VALIGN_MASK ) >> SYSTEM_STYLE_SHIFT ) ) {
case (int)( FIELD_BOTTOM >> SYSTEM_STYLE_SHIFT ):
return height - field.getHeight() - field.getMarginBottom();
case (int)( FIELD_VCENTER >> SYSTEM_STYLE_SHIFT ):
return field.getMarginTop() + ( height - field.getMarginTop() - field.getHeight() - field.getMarginBottom() ) / 2;
default:
return field.getMarginTop();
}
}
public Field getLeftField()
{
return _leftField;
}
public Field getRightField()
{
return _rightField;
}
public void replace( Field oldField, Field newField )
{
if( oldField == newField ) {
// Nothing to do
return;
}
if( oldField == _leftField ) {
_leftField = newField;
} else if( oldField == _rightField ) {
_rightField = newField;
}
add( newField );
delete( oldField );
}
}
Blackberry only Alpha Numeric characters in text field
EditField eField = new EditField("Enter letters and digits only: ", "")
{
protected boolean keyChar(char ch, int status, int time)
{
if (CharacterUtilities.isLetter(ch) || CharacterUtilities.isDigit(ch) || (ch == Characters.BACKSPACE))
{
return super.keyChar(ch, status, time);
}
return true;
}
};
Monday, January 2, 2012
Integrating PayPal to Blackberry & Flex Mobile
1.Download blackberry SDK from
Paypal SDK For All
Link: https://www.x.com/developers/paypal/documentation-tools/sdk#WSDL
2. Use Pdf in zip for Details
3. For Blackberry Testing on device APN Setting is Required (PayPal Mail Reference)
link: https://github.com/paypalx/mec-flex-mobile-shop
Paypal SDK For All
Link: https://www.x.com/developers/paypal/documentation-tools/sdk#WSDL
2. Use Pdf in zip for Details
3. For Blackberry Testing on device APN Setting is Required (PayPal Mail Reference)
FLEX MOBILE
For Flex Mobile USe Following Link Flex Paypal Linklink: https://github.com/paypalx/mec-flex-mobile-shop
Subscribe to:
Posts (Atom)