Sencha Touch + Cordova + Android – How to configure the project url?

i am developing a project which have multiple sub domain. i used Sencha Touch framework and Cordova for android app. In browser project is working fine. i build android apk with signing apk for release mode.

i have a serious problem in server handling in ajax. whenever i try to reach server side using ajax, user session getting destroyed.

And i have doubt in my cordova config.xml settings too.

My questions are :

  1. my project url like *.quiz.co . So How to config my config.xml file and How do i specific that custom url for my project. if i use window.open() or top.location.href or anything its redirect to my custom domain url but my android apk project works based on prodution codes not in apk codes.

  2. when i launch my android apk in my mobile its beginning url is “file:///assets/www.index.html“. So How can i run my application based on custom domain like *.quiz.co

  3. When i using redirect to custom domain. Server side User Session getting destroy in each ajax call. So How to maintain user session in ajax call ?

config.xml :

<?xml version='1.0' encoding='utf-8'?>

<name>Master Quiz</name>

<description>
    Quiz Application for Android platform.
</description>

<icon src="www/img/icon.png" />
<icon src="www/img/icon.png" platform="android" density="ldpi" />
<icon src="www/img/icon.png" platform="android" density="mdpi" />
<icon src="www/img/icon.png" platform="android" density="hdpi" />
<icon src="www/img/icon.png" platform="android" density="xhdpi" />

<content src="index.html" />

<platform name="android">
    <preference name="Fullscreen" value="true" />
</platform>

<feature name="InAppBrowser">
    <param name="android-package" value="org.apache.cordova.inappbrowser.InAppBrowser" />
</feature>

<!-- Wildcards are allowed for the protocol, as a prefix
to the host, or as a suffix to the path -->
<allow-navigation href="*" />

<!-- Allow all unrecognized URLs to open installed apps
    *NOT RECOMMENDED* -->
<allow-intent href="*" />

<!-- Don't block any requests -->
<access origin="http://*" />

</widget>

Android Permissions :

<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />


Source: .htaccess

Leave a Reply