+ Start a Discussion
niki4810niki4810 

Unable to launch hybrid_remote app on Android

Hi,

 

I am unable to load a hybrid_remote application that is pointing to a remote visual force page on Android.  Here are the steps I followed 

 

1) I installed the following visual force examples into  my DE

   - http://bit.ly/mobile_vf_phonebook

   - and the example mentioned in http://www2.developerforce.com/en/mobile/getting-started/html5#backbone

2) using forcedroid create command I created a hybrid_remote application, I pointed the start page as /apex/PhoneBook or /apex/MobileSample_Backbone (neither pages worked) 

3) I editied oauthRedirectURI (testsfdc:///mobilesdk/detect/oauth/done) and consumerkey in the bootconfig.json.

 

I use ecllipse for building and launching my application, when i launched the app (either on device or simulator) the app simply shows a blank screen.

 

I was expecting it to show a sfdc login screen followed by permission screen and upon clicking allow it would take me to my remote visual force page, but that dint work.

 

Could someone let me know if there is an issue with my configuration ? 

 

Thanks,

 

Nikhil

Best Answer chosen by Admin (Salesforce Developers) 
Pat PattersonPat Patterson

@Taneja,

 

The problem was that there are different versions of cordova-2.3.0.js for iOS and Android. If you copy the Android version of cordova-2.3.0.js (from the sample you created with forcedroid) over the one from the Backbone Mobile Pack, it should work.

 

I just tested this, and pushed an Android project to https://github.com/developerforce/MobilePack-BackboneJS/tree/master/Samples/BackboneHybrid-Android

 

Hope this helps!

 

Cheers,

 

Pat

All Answers

TanejaTaneja

HI Nikhil,

 

Try to see if ContactExplorer or any of the SampleApps is working or not. 

 

I am going through the same problem. Seems to be a problem with the Backbone Mobile Pack. For me, the SampleApps are working fine.

 

I am also looking into this, let me know if you find something.

niki4810niki4810
Hi Taneja,

I am able to run the remote apps now. Earlier I had the contact explorer app as well as a hybrid_remote app installed on my device. I was already logged into my SFDC accout via the contact explorer app. In this scenario when i tried to launch the hybrid_remote app, it dint show up.

But when I uninstalled my contact explorer app and re-deployed and launched the hybrid_remote app, it showed up. (initially i had to login again and then the app was showing up my remote visual force page)

Now when I re-installed my contact explorer app and tried to launch it, this time my the contact explorer app dint show up.

I am not a salesforce of android expert, but my guess is all the sample apps have some indentifier and the device is preventing multiple version of it to be launched on a same device.

Could you please try out this soultion and see if it works.

Thanks,
Nikhil
bhariharanbhariharan

The inability to run sample apps simultaneously, in some cases, is a known issue that we are looking into. Stay tuned for fixes in a future release (safe harbor). Meanwhile, if you install a sample app, complete the log in flow, and then install another sample app, both should work just fine. The problem only occurs when you have multiple sample apps installed, without logging into any of them.

niki4810niki4810
@bhariharan,

Thanks for the clarification. Looking forward for the fixes.

-
Nikhil
Pat PattersonPat Patterson

Taneja - did you get this working? I noticed you'd deleted your post in the other thread...

TanejaTaneja

@bhariharan,

 

Thanks for the information, it was a huge help. But I have run into another issue. I am trying to use the boiler plate code for mobilepack + backbonejs.

 

I can import the BackboneHybrid xcode project and it just runs smooth as a whistle.

 

For my current requirement, I want to use Backbonejs pack for an android app. So I create a new Android application with forcedroid and the replace the www folder with the same folder of BackboneHybrid Sample downloaded from github. I successfully build and can login to the app.

 

But after login, it's just the header "Contacts" with not back button and nothing, no contacts shown. Just the header and white backgroud. I tried digging around, but couldn't get much out of it. 

 

Here is a screenshot of LogCat:

https://www.dropbox.com/s/v0ovrxnef2al2ti/cordova.tiff

  

I am not using SQLite, and neither could find any reference. What would be the reason of this behaviour? How would you suggest to get started when I want to use Backbonejs + SalesforceMobileSDK- Android + SmartStore.

 

@metadaddy: Yes, I got this working,Thank you. But as mentioned above, having problem with getting Backbonejs running on Android. Can I ask you, why in Capturematic, you used the old Backbone.force libraries? 

Pat PattersonPat Patterson

@Taneja,

 

The problem was that there are different versions of cordova-2.3.0.js for iOS and Android. If you copy the Android version of cordova-2.3.0.js (from the sample you created with forcedroid) over the one from the Backbone Mobile Pack, it should work.

 

I just tested this, and pushed an Android project to https://github.com/developerforce/MobilePack-BackboneJS/tree/master/Samples/BackboneHybrid-Android

 

Hope this helps!

 

Cheers,

 

Pat

This was selected as the best answer
TanejaTaneja

@Pat,

 

Thanks for the reply and yeah it Works!!

 

Meanwhile, I also figured out the same. I was digging around DroidGap and realized that cordova has separate libraries for iOS and Android.

 

What I also did was, created a new package using forcedroid and just interchanged & modified index.html, not the entire www folder. 

 

I was gonna send you a pull request but you already made the changes, so kudos to that.

 

BTW, I am also making an Android app with the new Mobile Design Template + Backbonejs. If you would like, I can share the source code so that other people benefit.

 

PS.: You should use @metadaddy everywhere. It's a nice handle ;)

 

 

Pat PattersonPat Patterson

Hi Taneja - yes, please do share the source - it would be very useful. Drop me a message with the GitHub URL and I'll tweet it.

 

Yep - I am metadaddy pretty much everywhere:

 

http://twitter.com/metadaddy

http://slideshare.net/metadaddy

http://salesforce.stackexchange.com/users/67/metadaddy

http://www.last.fm/user/metadaddy

http://www.youtube.com/user/metadaddy

 

...etc...

Engine ForceEngine Force
I am unable to load a hybrid_local or remote application for Android in Eclipse (Luna). I followed the steps in the mobile sdk.pdf from salesforce.

1. npm install forcedroid –g
2. npm -g install cordova
3. forcedroid create
4. Build the project in Eclipse based on the instructions in the command line
5. modify bootconfig to use the Consumer key for the remote app in my developer org
set callback to same which is testsfdc:///mobilesdk/detect/oauth/done

The project builds fine in Eclipse (Luna). When I run the project,  I only see a black screen with controls on the right side, but on the left side, it's blank and eventually displays "Android". I don't get the salesforce login window.  Any insights?
Shukla YogeshShukla Yogesh
Hi 

I am facing several issues in this module. Please someone can list out the exact steps and commands that can work? Really frustrated after working more than 20 hours on this module.

1. The version mentioned in the trail isn't working properly and have bugs (as per stackexchange). It gives errors like package names should be x[.y.[. etc. Also same issue when it asks to create the page name.

2. I do not see the BOOTCONFIG file (no relevant file in any directory).

3. Even if I'm able to create the app git import doesn't finish and errros out showing there is is deference in versions.
User-added image



Thanks in advance,
Yogesh