BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-15-2006, 07:07 AM   #1 (permalink)
Thumbs Must Hurt
 
ujbandara's Avatar
 
Join Date: Aug 2005
Location: Upul Bandara from Colombo Sri Lanka -----------------------------
Model: 7290
Carrier: Dialog
Posts: 153
Post Thanks: 0
Thanked 0 Times in 0 Posts
Question Extract BB device PIN using Midlet…….. ?

Please Login to Remove!

Hi,

Is it possible to Extract BB device pin No via midlet.

(I am using Netbeans to develop mildlet for BB device)
__________________
Did you ever compare Affrican Elephants and Sri Lankan Elephants?
Where are classic Elephants?

Upul
Offline  
Old 08-15-2006, 08:22 AM   #2 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

DeviceInfo.getDeviceId() gives you the BB-Pin
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 08-15-2006, 09:14 AM   #3 (permalink)
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

is deviceinfo part of the microedition api or is it a rim api?
Offline  
Old 08-15-2006, 11:21 AM   #4 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

can't find it in the api right now but i would guess that it's rim as other devices do not have a PIN...
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 08-16-2006, 12:11 AM   #5 (permalink)
New Member
 
Join Date: Sep 2005
Model: 7290
Posts: 13
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,

where is "DeviceInfo.getDeviceId() " method?
how do i import those methods/ apis?
Offline  
Old 08-16-2006, 05:23 AM   #6 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

net.rim.device.api.system.DeviceInfo

if you work with the RIM JDE or integrate it into another JDE you can access those classes. The JDE can be downloaded free of charge at RIMs website
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 08-17-2006, 05:26 AM   #7 (permalink)
Thumbs Must Hurt
 
ujbandara's Avatar
 
Join Date: Aug 2005
Location: Upul Bandara from Colombo Sri Lanka -----------------------------
Model: 7290
Carrier: Dialog
Posts: 153
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

What is best way to integrate JDE with Netbeans editor?
__________________
Did you ever compare Affrican Elephants and Sri Lankan Elephants?
Where are classic Elephants?

Upul
Offline  
Old 08-17-2006, 05:43 AM   #8 (permalink)
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by ujbandara
What is best way to integrate JDE with Netbeans editor?
that i can help you with, i blogged a guide for doing this, unfortunately i forgot to pay my bill this month (again) so the site is down, use the google cache: MeshTech News - and scroll down to the relevant article. i've quoted the text below:

Step1 - download and install Netbeans (this tutorial was done using the preview of netbeans 5.5)

Step2 - download and install Netbeans Mobility Pack

Step3 - download and install blackberry jde 4.1

Step4 - Launch Netbeans, from the toolbar select tools > java platform manager > add platform and select 'custom java micro edition platform emulator' - View image

Step5 - Enter (or paste) 'C:\Program Files\Research In Motion\BlackBerry JDE 4.1.0' as the Platform Home, then add 'Platform Name' and 'Device Name' - View image

Step6 - Select 'Next', From the 'Bootstrap Libraries' list, remove every item except 'net_rim_api.jar' - View image

Step7 - Select 'Next', Ignore the 'Sources' pane but add the path to the Blackberry javadocs: 'C:\Program Files\Research In Motion\BlackBerry JDE 4.1.0\docs\api\' then click 'finish' - View image

Step8 - Restart Netbeans

Step9 - Create a new project by selecting 'mobile application' from the 'mobile category' - - View image. for this tutorial the application is called 'bb_test', uncheck the 'Create Hello Midlet' option - View image

Step10 - Select the Blackberry platform that you created in steps 1 to 8 - View image

Step11 - Add this xml data to the build.xml file which is visible if you select the 'Files' pane - View image

Step12 - Next you need to create an .alx file which is a Blackberry 'Application Loader' xml file, in the 'Files' pane, right-click and select 'new' > 'empty file' - View image
Name the file the same as your application - View image - and add this xml data

Step13 - You're now ready to start writing your application, switch back to the 'Project' pane and create a new java source file - View image

Here's a simple small application to get you started:

//start import net.rim.device.api.ui.component.*; import net.rim.device.api.ui.container.*; import net.rim.device.api.ui.*;

class myApp extends UiApplication {
public static void main(String[] args){
myApp instance = new myApp();
instance.enterEventDispatcher();
}

public myApp(){
pushScreen(new myScreen());
}
}

class myScreen extends MainScreen{
BasicEditField queryField = new BasicEditField("Query: ", "");
ButtonField submitButton = new ButtonField("Submit", ButtonField.CONSUME_CLICK);

public myScreen(){
add(queryField);
add(submitButton);
}
}
//eof

If you click on the 'File' pane your directory structure should look similar to this image - View image

Step14 - Netbeans still expects your project to be a standard midlet based application, we have to cheat slightly and enter the name of our main class as the midlet name (the class that will extend UIApplication), right-click on your project and select properties, select 'MIDlets' > 'Add' - View image - There will be a warning message, ignore it - View image

Step15 - All being well you should now be able to write, compile and run your native blackberry application and test in the emulator all from netbeans - View image

[NOTE] - the text you need to add inside the </project> tag of the buildxml file is:

<property name="rim.blackberry.home" location="C:\Program Files\Research In Motion\BlackBerry JDE 4.1.0"/>
<property name="rim.blackberry.emulator" value="8707v"/>

<target name="post-jar">
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows XP" dir="${dist.dir}" executable="${rim.blackberry.home}/bin/rapc.exe" failonerror="true" resolveExecutable="true">
<arg value="import=${rim.blackberry.home}/lib/net_rim_api.jar"/>
<arg value="codename=${name}"/>
<arg value="${dist.jad}"/>
<arg value="${dist.jar}"/>
</exec>
<copy file="${name}.alx" todir="${dist.dir}"/>
</target>

<target name="run" depends="init,jar">
<copy todir="C:\Program Files\Research In Motion\BlackBerry Device Simulators 4.1.0\Device Simulators 4.1.0.316" verbose="true">
<fileset dir="${dist.dir}">
<include name="**/${name}.*"/>
</fileset>
</copy>
<exec os="Windows NT Windows 95 Windows 98 Windows 2000 Windows XP" dir="C:\Program Files\Research In Motion\BlackBerry Device Simulators 4.1.0\Device Simulators 4.1.0.316" executable="C:\Program Files\Research In Motion\BlackBerry Device Simulators 4.1.0\Device Simulators 4.1.0.316/${rim.blackberry.emulator}.bat" failonerror="true" resolveExecutable="true"/>
</target>

<target name="debug" depends="init,jar">
<copy todir="C:\Program Files\Research In Motion\BlackBerry Device Simulators 4.1.0\Device Simulators 4.1.0.316" verbose="true">
<fileset dir="${dist.dir}">
<include name="**/${name}.*"/>
</fileset>
</copy>
<delete file="${preprocessed.dir}/.timestamp"/>
<parallel>
<property name="jpda.port" value="8000"/>
<java jar="${rim.blackberry.home}/bin/JDWP.jar" fork="true" dir="${rim.blackberry.home}/bin">
<jvmarg value="-Xmx128M"/>
</java>
<sequential>
<sleep seconds="5"/>
<antcall target="nbdebug"/>
</sequential>
</parallel>
</target>

<target name="post-clean">
<echo>Post clean</echo>
<delete>
<fileset dir="C:\Program Files\Research In Motion\BlackBerry Device Simulators 4.1.0\Device Simulators 4.1.0.316">
<include name="**/${name}.*"/>
</fileset>
</delete>
</target>
Offline  
Old 08-18-2006, 01:41 AM   #9 (permalink)
Thumbs Must Hurt
 
ujbandara's Avatar
 
Join Date: Aug 2005
Location: Upul Bandara from Colombo Sri Lanka -----------------------------
Model: 7290
Carrier: Dialog
Posts: 153
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks...

Step 11 is ok.

If possible Please let us know futher info on Step12
What kind of XML data to be add to that alx file?
__________________
Did you ever compare Affrican Elephants and Sri Lankan Elephants?
Where are classic Elephants?

Upul
Offline  
Old 11-09-2006, 04:26 AM   #10 (permalink)
CrackBerry Addict
 
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

just found this following a link in another thread, here's the text you need to add to the .alx file missing from the above guide, added for completeness:

<loader version="1.0">
<application id="myApp">
<name >
</name>

<description >
</description>

<version >
</version>

<vendor >
MyCompany
</vendor>

<copyright >
Copyright (c) 2006 MyCompany
</copyright>

<fileset Java="1.5">
<directory >
MyCompany
</directory>

<files >
myApp.cod
</files>
</fileset>

</application>

</loader>
Offline  
Old 11-09-2006, 04:30 AM   #11 (permalink)
Talking BlackBerry Encyclopedia
 
Join Date: Nov 2006
Model: 8100
Carrier: Airtel
Posts: 335
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ahhh, I was just copying my alx file to give him - jfisher has been fast there. There is a detailed tutorial on this on Blackberry Development Using NetBeans Mobility but the Fooling the Netbeans to make it believe that the app is a midlet is contribution of Jfisher. Thanks.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright © 2004-2014 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.