Bohdan Vorona
Bohdan Vorona

Reputation: 725

AngularJS + jQuery + mobile angular ui + phonegap = fail

I'm trying to build my first mobile app. What I usying: AngularJS, Mobile Angular UI, jQuery and PhoneGap.

My code:

<!doctype html>
<html>
<head>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular-route.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular-touch.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <link rel="stylesheet" href="/mobile-angular-ui/dist/css/mobile-angular-ui-base.min.css" />
    <link rel="stylesheet" href="/mobile-angular-ui/dist/css/mobile-angular-ui-desktop.min.css" />
    <link rel="stylesheet" href="/css/demo.css" />
    <script src="/mobile-angular-ui/dist/js/mobile-angular-ui.min.js"></script>
</head>
<body ng-app="MyApp" ng-controller="MainController">

   HERE HTML CODE

<script>

   HERE ALL LOGIC

</script>
</body>
</html>

In all browsers all works fine, but when I getting apk file from PhoneGap and running it on my Nexus 4 (Android) I seeing white screen :*(

Upvotes: 1

Views: 1535

Answers (1)

frank
frank

Reputation: 3330

you need to add the below line at the start of the the head tag

<script type="text/javascript" src="cordova.js"></script>

Also make sure you check the deviceready event to make any native device API calls.

Upvotes: 2

Related Questions