Android/Xamarin is not working on with api 17

ayadhalalayadhalal AEMember ✭✭

Hello ,

Im building a mob app targeting android in Xamarin studio .I made the minimum and target android version is 4.2 jelly bean .
The app is working perfectly on my phone samsung duos 4.4.4 and on the emulator 4.4.2 but Im trying to test it on emulator running 4.2.2 ,it is not working and the application stops responding .
Im somehow sure it has to do with the SDK and i tried to set the link behavior to : no linking ,linking sdk assemblies and link all but nothing is working .
It may also worth mentioning that im using hybrid app (webview + javascript/jQuery)

Appreciate any ideas ?

Regards
Ayad

Answers

  • MihaMarkicMihaMarkic SI ✭✭✭✭

    Start by taking a look at logcat.

  • ayadhalalayadhalal AEMember ✭✭

    Thanks ,but how I exactly use it ? And do you want me to send/share the logs ?

  • MihaMarkicMihaMarkic SI ✭✭✭✭

    Here is one way. Usually when an application crashes there is a lot of info in there, like call stack that lead to crash.

  • ayadhalalayadhalal AEMember ✭✭

    Hello Miha

    I did lots of testing and i found that jquery.mobile-1.4.5.js is causing the issue and you can simply test it in xamarin by selecting new android web view solutions and insert the below references :



    The result will be a blank page with the loading icon spinning .This is exactly what Im getting in my app .
    I tested that the same issue occurs with 4.2 ,4.3 but with 4.4 Android .

    I cant figure out what is really causing the issue ? appreciate any ideas here.

    Thanks

  • MihaMarkicMihaMarkic SI ✭✭✭✭

    Could be that Android's browser (WebView) is having problems? Note that there are different versions out there.
    BTW the references you are mentioning aren't visible in the post above.

  • ayadhalalayadhalal AEMember ✭✭

    Sorry ,i think the links were removed probably due to the tag .They are simply script reference to the jQuery 1.4.5 mobile javascript file and its css in the html file .
    <rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
    <src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js">

    Well it is probably the webview but it is so strange that Im not able to find more info if the issue has been reported .

  • ayadhalalayadhalal AEMember ✭✭

    Further testing it seems that the issue seems to be occurring from the jquery.mobile-1.4.5.min.css .I tried older ones ,the issue is still there and it is simply can be seen if you reference them in a fresh new webview android solution .Maybe the css has features that is not compatible with the webview but i cant tell what.Can you check and let me know if you face the same ?

  • MihaMarkicMihaMarkic SI ✭✭✭✭

    Works fine for me. See attached sample.

  • ayadhalalayadhalal AEMember ✭✭

    Yea ,thats is working but Im using hybrid application template .The steps to reproduce is
    -Open Xamarin
    -File-->New-->Solution-->Android WebView App
    -Now click run to test the application .
    -Stop debugging and click on the Views folder on the left pane ,you should be able to see the RazorView.cshtml
    -Open the RazorView.cshtml file
    -Check the head tag ,it only has reference to the css file
    -Now add references to the jquery mobile and its css from the below link
    http://blog.jquerymobile.com/2014/10/31/jquery-mobile-1-4-5-released/
    from the 'Copy-and-Paste Snippet for CDN-hosted files'
    -Now run the app ,you will see a blank page with the loading icon spinning .

    Let me know if you are able to reproduce .

  • MihaMarkicMihaMarkic SI ✭✭✭✭

    @ayadhalal Works for me on both Genymotion and Nexus 6.

  • ayadhalalayadhalal AEMember ✭✭

    Did you test this on 4.2 or 4.3 android ? You won't see issues if it is 4.4 .

  • MihaMarkicMihaMarkic SI ✭✭✭✭

    Actually I've managed to repro on 4.2.2/Genymotion.
    Looks like the problem happens only when loading from string as opposed to loading an URL.
    I've also found out that if you change baseUrl (file:///android_asset/) to something else (i.e. http://misc.rthand.com/) then it works but probably won't find local resources.
    You might file a bugzilla bug report I guess.

  • ayadhalalayadhalal AEMember ✭✭

    Yea i tested on 4.2.2 and i have a repro as well ,but try to remove the css reference ,it will work ? It is strange that i couldn't find ppl experiencing this issue .

Sign In or Register to comment.