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

Web and WebWorks Development

Reply
New Contributor
Posts: 4
Registered: ‎12-20-2010
My Device: Not Specified
Accepted Solution

Get Personal Contacts list in a .NET Web Application

Hi All,

 

My question is how to get personal email contacts from a BB device in a .NET web application?

 

I have seen the following javascript code

 

<script type="text/javascript">

var args = new blackberry.invoke.MessageArguments('foo@domain.com', 'hello', 'world');
args.view = blackberry.invoke.MessageArguments.VIEW_NEW; // New

blackberry.invoke.invoke(blackberry.invoke.APP_MESSAGES, args);  // New Message
</script>

 

Can this piece of code be used in any web application(e.g. a .net web application)?

 

As the subject says, I'm looking at how to get personal contacts list(emails) from bb device in a .net web page.

 

Any help/advice is welcomed!

 

Thanks!

 

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Get Personal Contacts list in a .NET Web Application

Hello,

 

The snippet of code you provided can be used within a BlackBerry application created using the BlackBerry WebWorks application framework (not the native BlackBerry browser).

 

This framework enables web content to access a variety of existing and custom JavaScript APIs that grant access to enhanced device capabilities (such as the ability to read/write from the address book).

 

You can leverage the .NET framework by loading .NET web pages, deployed on a web server, within your WebWorks applications.  Depending on how the domains for these pages have been whitelisted in the WebWorks app, they may even be allowed to have access to he above-mentioned JavaScript objects.

 

The following sample application may be a helpful learning resource:  "Using PIM information sample code".

 

Sincerely,

Adam

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
New Contributor
Posts: 4
Registered: ‎12-20-2010
My Device: Not Specified

Re: Get Personal Contacts list in a .NET Web Application

Thanks Adam for your quick response.

 

I'm not using the Blackberry WebWorks Framework.

 

Maybe I wasn't very clear in my initial question.

 

We have developed some web applications in .net using Visual Studio and .net frameworks.

At some point we need to access the personal contact list from the bb device. In fact we need to retrive the emails from this list.

 

So the question is how can we do this on the client side so when a user types something on a "email" type "textbox" that javascript function would return a list of available contacts(emails).

 

E.g. user types "rem" in a textbox so javascript returns all emails contacts that contain the "rem" keyword.

 

Thanks,

Remus

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Get Personal Contacts list in a .NET Web Application

You cannot do this if your users access your web content using the BlackBerry browser because the browser does not expose address book info.

 

You can do this if your users access your web content through an application created using the WebWorks framework.  Within this framework there exists a JavaScript object named Find that can be used to retrieve address book entries.

 

Does that make sense?  For the type of functionality you require, you will need to move away from the browser as your delivery mechanism and into a separate client application (WebWorks).

 

Hope that helps,

Adam

 

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
New Contributor
Posts: 4
Registered: ‎12-20-2010
My Device: Not Specified

Re: Get Personal Contacts list in a .NET Web Application

Hi Adam,

 

Thanks again for your response.

So what you're saying is there is no way we can do this(invoke address book from device) in Visual Studio in ASP.NET(Web application on Blackberry Browser).

What if we want to develop a Widget for BB device?(I assume this is a client app on BB device)

Now, looking at the documentation for "Installing the Blackberry web plug in" at

 

http://docs.blackberry.com/en/developers/deliverables/20765/System_requirements_613876_11.jsp

 

If you look at the bottom there is "Java® Development Kit" :smileyhappy:

How this works with Visual Studio? I mean by the end am I going to develop in Jaava or .NET? :smileyhappy:

 

So if I install all the requirements according to the list can I develop a client application in .NET that after I can download it to a Blackberry device?

 

Hopfully this does not sound too stupid. But if does please do not hesitate to laugh :smileyhappy:

 

Thanks,
Remus

 

 

New Contributor
Posts: 4
Registered: ‎12-20-2010
My Device: Not Specified

Re: Get Personal Contacts list in a .NET Web Application

Okay: I figured it out.

 

I need a new widget app for this.

 

Well, this opens a new chapter for me! 

 

Thanks for you replays.

 

Remus