BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/)
-   Developer Forum (http://www.blackberryforums.com/developer-forum/)
-   -   Extract BB device PIN using Midlet…….. ? (http://www.blackberryforums.com/developer-forum/43813-extract-bb-device-pin-using-midlet.html)

ujbandara 08-15-2006 06:07 AM

Extract BB device PIN using Midlet…….. ?
 
Hi,

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

(I am using Netbeans to develop mildlet for BB device)

simon.hain 08-15-2006 07:22 AM

DeviceInfo.getDeviceId() gives you the BB-Pin

jfisher 08-15-2006 08:14 AM

is deviceinfo part of the microedition api or is it a rim api?

simon.hain 08-15-2006 10:21 AM

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...

youpul 08-15-2006 11:11 PM

hi,

where is "DeviceInfo.getDeviceId() " method?
how do i import those methods/ apis?

simon.hain 08-16-2006 04:23 AM

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

ujbandara 08-17-2006 04:26 AM

What is best way to integrate JDE with Netbeans editor?

jfisher 08-17-2006 04:43 AM

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>

ujbandara 08-18-2006 12:41 AM

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?

jfisher 11-09-2006 03:26 AM

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>

dollars5 11-09-2006 03:30 AM

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.


All times are GMT -5. The time now is 04:26 AM.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.