Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
Posts: 28
Registered: ‎03-15-2012
My Device: BB 9810
My Carrier: Du-UAE

My first Bluetooth App - I need some help

Dear developers,

 

This is the first time I write programs for a Blackberry device
I am working on BlackBerry Plug-in for Eclipse 7.0
but having few issues that I hope you help me with:

 

1- When I run my app on a device it says I'm trying to access secured API's
2- I can not use the simulator on my laptop as it says "bluetooth is not supported"
(but my laptop has a bluetooth!)
3- I tried to understand the -"Bluetooth Demo" sample- but it seems complicated and
doing more than what I was planning to do

 

In brief, all I need is to make a serial connection with another bluetooth enabled device and just send a character

 

I wish to get a positive responce from you

 

Thank you all
^___^

Developer
Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: My first Bluetooth App - I need some help

welcome to the support forums

1. sign your app. see https://www.blackberry.com/SignedKeys/
2. simulator does not simulate bluetooth, you have to use a real device
3. the demos often cover several topics at one, just extract what you need.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 28
Registered: ‎03-15-2012
My Device: BB 9810
My Carrier: Du-UAE

Re: My first Bluetooth App - I need some help

Thanks for your reply ^_^

To be honest with you..
this is my first mobile app and I'm confused a little
I read on
http://docs.blackberry.com/en/developers/deliverables/11938/Use_a_Bluetooth_serial_port_connection_5...

then used the "Bluetooth Demo" sample and got lost in all that code
do you know any simpler sample i can work with ?
Developer
Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: My first Bluetooth App - I need some help

no, i based my first bt app on this sample as well. you have to take some time to understand it, most likely.
the main work is in the thread it spawns.

if you have specific questions don't hesitate to ask them. unfortunately you have not taken the most easiest topic to start with Smiley Happy
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 28
Registered: ‎03-15-2012
My Device: BB 9810
My Carrier: Du-UAE

Re: My first Bluetooth App - I need some help

I did not get these ?
"the main work is in the thread it spawns"


Anyways, I went through the sample and tried to understand it
but the issue is my little knowledge in this field Smiley Frustrated

When i make a new app
there is the screen and there is the main .java

but in the sample there is a SPPScreen.java that looks Chinese language to me and could not understand Smiley Frustrated

I can make my app in just a screen & main.java right ?
Developer
Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: My first Bluetooth App - I need some help

yes. i would suggest to start with a simple hello world app.
maybe you work with some simple samples first?

to execute blocking code, like I/O on bluetooth, you need to start a separate thread, this is done in the bt demo.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 28
Registered: ‎03-15-2012
My Device: BB 9810
My Carrier: Du-UAE

Re: My first Bluetooth App - I need some help

I got it now, i need that SPPScreen.java for I/O on bluetooth
so in my case i need three .java files

I'd start again from the basics as I got so confused of that bt code Smiley Frustrated

do you have a simple way to learn how to program that app?
I downloaded the manuals available by Blackberry
and that is all I have
http://docs.blackberry.com/en/developers/subcategories/?userType=21&category=Java+Development+Guides...
Developer
Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: My first Bluetooth App - I need some help

no, there is no easy way to develop a bt app, you have to work your way through it.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 28
Registered: ‎03-15-2012
My Device: BB 9810
My Carrier: Du-UAE

Re: My first Bluetooth App - I need some help

Thanks ^_^
you helped me a lot..

Now, I am building on that hello world app
and hopefully would get my app soon
Contributor
Posts: 28
Registered: ‎03-15-2012
My Device: BB 9810
My Carrier: Du-UAE

Re: My first Bluetooth App - I need some help

I need to take an input from the user
I used the following

BasicEditField enterUsername = new BasicEditField("Username: ", "");
PasswordEditField enterPIN = new PasswordEditField("PIN: ", "", 7, PasswordEditField.FILTER_DEFAULT);
add(enterUsername);
add(enterPIN);


the issue is how to make my app hold to read these input
then go to the next instruction ^_^