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
Developer
arindamhit
Posts: 271
Registered: ‎12-24-2010
My Device: BlackBerry 10
My Carrier: Airtel

How to return back to my application from the Browser??

Hi,

 

I am developing one application where  after launching the app it will display one URL. When user click the done button, the link will be open on the browser and after some user authentication, it will immediatly come back to my application again and in the same screen.

  Now for this, i have tried  with HttpFilterRegistry to get the solution. But using that, i got some sort of digfferent solution like when when i will open the link (URL), i am able to launch my application. But here i have to first launch my app, from where i have to launch the browser and then againg have to coming back to my application.

 

Please help me..

 

Thanks..

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to return back to my application from the Browser??

I would try to do this in a BrowserField.  Have you investigated that option?

Please use plain text.
Developer
arindamhit
Posts: 271
Registered: ‎12-24-2010
My Device: BlackBerry 10
My Carrier: Airtel

Re: How to return back to my application from the Browser??

Using BrowserField, i can open that URL. But after that, how i will come back to my application??

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to return back to my application from the Browser??

With a BrowserField, you never leave the application.  So say you want to display a page from the web in your application.  You will push a new MainScreen, which contains a BrowserField, and you will set that BrowserField to the page you want to display.  Then pressing the back button, will close the MainScreen containing the BrowserField and display the screen that was there before. 

 

Search for the various KB articles that talk about BrowserField and interactions with the application. 

Please use plain text.
Developer
arindamhit
Posts: 271
Registered: ‎12-24-2010
My Device: BlackBerry 10
My Carrier: Airtel

Re: How to return back to my application from the Browser??

Sorry peter. I am not asking for that. I will click the button which will open the URL in the browser and get downloaded some tokens to my phone. Then again i will redirected to my app again. 

 

As you are telling, i will display the URL in Browser field in another screen and clicking back button, coming to back my app. This is not i am looking.

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to return back to my application from the Browser??

Sorry not something I am familiar with, but if you look at the Facebook SDK, it seems that it does exactly what you are asking with the facebook token.  That would be a good place to start. 

Please use plain text.
Developer
arindamhit
Posts: 271
Registered: ‎12-24-2010
My Device: BlackBerry 10
My Carrier: Airtel

Re: How to return back to my application from the Browser??

Now i am trying to first open the link in the browser and then pass the url using Filter Registry. Lets see i can make it or not.

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to return back to my application from the Browser??

Sorry just re-read your response and noted that I did not answer your question.

 

The first point that needs clarification is this.  YOu said:

"I will click the button which will open the URL in the browser"

 

Remember that the Browser is a aseparate application and has not knowledge or even interest in your application.  So if you open in a Browser like this you re going to make life difficult for you to get back to your application.

 

So my quesiotn to you is simply this.

 

Why do you need to do this in the Browser?  Why can't you do this in a BrowserField? 

 

Please use plain text.