How to make dynamic apps using Phonegap?

  • 2
  • Problem
  • Updated 6 months ago
Hi there, i am a student creating an app. But having some problems, i still cudn't found that what are the plugins and how we can use i used many from list but all they are not responding. Phonegap Team please help me i just want to create an app with camera(to capture images) and Call(to a particular number) how i can use them? I am using build.phonegap.com using dreamweaver. Thanks in advance. I also attached the screen shot of my app
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes

Posted 4 years ago

  • 2
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
It's also fetching details from database:
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
Oops! i did some spelling mistakes let me update database.
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
i updated now, Petra so it's correct coding?
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
You must be kidding me. How can the app fetch data from a remote database with this code:

$.getJSON("compltype-data.php", function(return_data){...
???

Does your app have any clue where to find that server side script?
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
Means? I was checking it on local server not on remote server. It's fetching data from localhost. So. If i will use this script for remote server, It will not work?
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Oh, I thought you said you wanted to test on a free hosting platform, first. You never said anything about testing on a local machine.

Furthermore, I was surprised that you are using jQuery for this. If you do, you shouldn't mix it up with vanilla javascript as in your previously posted code. That would quickly become a mess and hardly maintainable.
You should then rewrite code, such as

function EnableDisableTextarea(othercheck) {
var otherdescription = document.getElementById("otherdescription");
otherdescription.disabled = othercheck.checked ? false : true;
student.disabled = othercheck.checked ? true : false;
otherdescription.style.background = "#DDD";
...


so it's done with the more convenient jQuery framework.
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
Petra Good Night I am sleeping now, my parents are in a fix :D coz everytime i hold my laptop, now my mom is snatching laptop, she want i sleep,
dialog boxes work I will do tomorrow, If Allah wills, aameen Have a safe night.
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
Dear Petra, Good Morning
I can't joke or fun here, because I am too much serious for my app:
I tested yet on localhost:
But last night when u said



I quickly upload my config.php, complaints.php, complaint-data.php, complaint-list.php.
and check on remote server, but it's really fetching data on remote server too:
check my ftp server details.

I upload my webpages and checked it's fetching details into pick list.
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
??
So you uploaded both your server side scripts and your html assets to the same server and retried?
Yes, that would be no difference with your localhost situation.

But what are you actually testing, then? Certainly NOT the client/server situation with a separate device. Certainly not a built app, executed in a device webview (with necessary whitelisting).
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
Then, what is the process, want a little hint
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Act as a regular user.
Install the apk and/or ipa on a regular device, go out onto the street and file a complaint using your app. Create following situations:
- with and without mobile internet connection
- with and without geolocation service
- using Android and iOS
- without picture, with camera picture and with picture from gallery
...and see if everything works as expected.
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
-yes my next work was to create alert/dialog boxes for handled and unhandled situations, offline and online notifications.

-supported geo location or not.

-both platforms

-without picture and camera gallery

-yes i will check then.

I changed the enable/disable code as u said.
Q1. So, in which place or folder i can place my scripts files?
Q2. So, fetching data is correct?
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Q1. Client side: in your assets. Server-side: on a remote server, together with your database
Q2. As long as you're assuming that your app is a website at the same location as your server side scripts, yes. Otherwise, no.
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
I can't treat my App like a Dynamic website? This is truth that currently I am testing my app on local server, but after successful build, I download apk file and Install it in my phone, if it's working fine.
Secondly I didn't call ajax XHR yet, So, after ajax call on the remote server with database, I can final check the app, that it's working fine or not, i can test on various platform and from various places i can check.
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
Same site map for local or remote:
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
By d way, I wanna move ahead,, with positive hopes, I can do In Shaa Allah see u soon.
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
Respected Petra,
I am gonna use this plugin for network offline and online status: Is it correct?
cordova-plugin-network-information
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Yes
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
Petra
I am working on "Icons and Splash screens
Have little doubt. I have one icon file, which working on my android app,
Should i configure different different icons and splashes for different platforms?

<!-- iPhone 6 / 6+ -->
<icon src="icon-60@3x.png" platform="ios" width="180" height="180" />

<!-- iPhone / iPod Touch -->
<icon src="icon-60.png" platform="ios" width="60" height="60" />
<icon src="icon-60@2x.png" platform="ios" width="120" height="120" />

<!-- iPad -->
<icon src="icon-76.png" platform="ios" width="76" height="76" />
<icon src="icon-76@2x.png" platform="ios" width="152" height="152" />

<!-- Settings Icon -->
<icon src="icon-small.png" platform="ios" width="29" height="29" />
<icon src="icon-small@2x.png" platform="ios" width="58" height="58" />

<!-- Spotlight Icon -->
<icon src="icon-40.png" platform="ios" width="40" height="40" />
<icon src="icon-40@2x.png" platform="ios" width="80" height="80" />
<!-- iPhone / iPod Touch -->
<icon src="icon.png" platform="ios" width="57" height="57" />
<icon src="icon@2x.png" platform="ios" width="114" height="114" />

<!-- iPad -->
<icon src="icon-72.png" platform="ios" width="72" height="72" />
<icon src="icon-72@2x.png" platform="ios" width="144" height="144" />

<!-- iPhone Spotlight and Settings Icon -->
<icon src="icon-small.png" platform="ios" width="29" height="29" />
<icon src="icon-small@2x.png" platform="ios" width="58" height="58" />

<!-- iPad Spotlight and Settings Icon -->
<icon src="icon-50.png" platform="ios" width="50" height="50" />
<icon src="icon-50@2x.png" platform="ios" width="100" height="100" />
<icon src="ldpi.png" platform="android" qualifier="ldpi" />
<icon src="mdpi.png" platform="android" qualifier="mdpi" />
<icon src="hdpi.png" platform="android" qualifier="hdpi" />
<icon src="xhdpi.png" platform="android" qualifier="xhdpi" />
<icon src="xxhdpi.png" platform="android" qualifier="xxhdpi" />
<icon src="fr-xxhdpi.png" platform="android" qualifier="fr-xxhdpi" />
<icon src="icon.png" platform="winphone" />
<icon src="tileicon.png" platform="winphone" role="background" />
<icon platform="winphone" width="44" height="44" src="res/Square44x44Logo.scale-100.png" />
<icon platform="winphone" width="106" height="106" src="res/Square44x44Logo.scale-240.png" />
<icon platform="winphone" width="150" height="150" src="res/Square150x150Logo.scale-100.png" />
<icon platform="winphone" width="360" height="360" src="res/Square150x150Logo.scale-240.png" />
<icon platform="winphone" width="71" height="71" src="res/Square71x71Logo.scale-100.png" />
<icon platform="winphone" width="170" height="170" src="res/Square71x71Logo.scale-240.png" />
<icon platform="winphone" width="310" height="150" src="res/Wide310x150Logo.scale-100.png" />
<icon platform="winphone" width="744" height="360" src="res/Wide310x150Logo.scale-240.png" />

Splash Screen

<!-- iPhone and iPod touch -->
<splash src="Default.png" platform="ios" width="320" height="480" />
<splash src="Default@2x.png" platform="ios" width="640" height="960" />

<!-- iPhone 5 / iPod Touch (5th Generation) -->
<splash src="Default-568h@2x.png" platform="ios" width="640" height="1136" />

<!-- iPhone 6 -->
<splash src="Default-667h@2x.png" platform="ios" width="750" height="1334" />
<splash src="Default-Portrait-736h@3x.png" platform="ios" width="1242" height="2208" />
<splash src="Default-Landscape-736h@3x.png" platform="ios" width="2208" height="1242" />

<!-- iPad -->
<splash src="Default-Portrait.png" platform="ios" width="768" height="1024" />
<splash src="Default-Landscape.png" platform="ios" width="1024" height="768" />

<!-- Retina iPad -->
<splash src="Default-Portrait@2x.png" platform="ios" width="1536" height="2048" />
<splash src="Default-Landscape@2x.png" platform="ios" width="2048" height="1536" />
<splash src="ldpi.png" platform="android" qualifier="ldpi" />
<splash src="mdpi.png" platform="android" qualifier="mdpi" />
<splash src="hdpi.png" platform="android" qualifier="hdpi" />
<splash src="xhdpi.png" platform="android" qualifier="xhdpi" />
<splash src="fr-xhdpi.png" platform="android" qualifier="fr-xhdpi" />
<splash src="portrait-xxhdpi.png" platform="android" qualifier="port-xxhdpi" />
<splash src="landscape-xxhdpi.png" platform="android" qualifier="land-xxhdpi" />

These icons (Idpi.png, mdpi.png, hdpi.png) I iwll create them with different resolution or they will load by default?
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
You need to create all icons and splashes separately in the exact correct dimensions.

And what is this:
<icon src="fr-xxhdpi.png" platform="android" qualifier="fr-xxhdpi" />
Why do you need one french localized icon, and only in the size?

Be aware that you need the correct orientation(s), depending on the orientation preference in your config.
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
Is there any plugin for splash screens? like
cordova-plugin-splashscreen
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
yes.
Why didn't you look it up in npm?
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
one question more petra sir,
that
i saw in many example that they declared images's height and width, so when i will create icons in adobe photoshop, so i wll set their resolution if icon have height and width respectively: 320x480?

<splash src="res/screen/ios/Default~iphone.png" width="320" height="480"/>
?
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Correct.
btw: you don't have to use exactly these paths and file names. This would be just as well:

<platform name="ios">

<splash
src="mysplashes/ios/portrait320.png"
width="320" height="480"
/>
</platform>
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
:D :D :D i used this website to create icons and screens automatically:
http://pgicons.abiro.com/
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
Dear Petra, Please check my splash screen and icon configuration!, Thank You

<!-- SPLASH SCREENS-->
<platform name="android">
<!-- you can use any density that exists in the Android project -->
<splash src="res/screens/android/screen-hdpi-land.png" density="land-hdpi"/>
<splash src="res/screens/android/screen-ldpi-land.png" density="land-ldpi"/>
<splash src="res/screens/android/screen-mdpi-land.png" density="land-mdpi"/>
<splash src="res/screens/android/screen-xhdpi-land.png" density="land-xhdpi"/>

<splash src="res/screens/android/screen-hdpi-portrait.png" density="port-hdpi"/>
<splash src="res/screens/android/screen-ldpi-portrait.png" density="port-ldpi"/>
<splash src="res/screens/android/screen-mdpi-portrait.png" density="port-mdpi"/>
<splash src="res/screens/android/screen-xhdpi-portrait.png" density="port-xhdpi"/>
</platform>
<platform name="ios">
<!-- images are determined by width and height. The following are supported -->
<splash src="res/screens/ios/screen-iphone-portrait.png" width="320" height="480"/>
<splash src="res/screens/ios/screen-iphone-portrait-2x.png" width="640" height="960"/>
<splash src="res/screens/ios/screen-iphone-land.png" width="480" height="320"/>
<splash src="res/screens/ios/screen-iphone-land-2x.png" width="960" height="640"/>
<splash src="res/screens/ios/screen-ipad-portrait.png" width="768" height="1024"/>
<splash src="res/screens/ios/screen-ipad-portrait-2x.png" width="1536" height="2048"/>
<splash src="res/screens/ios/screen-ipad-land.png" width="1024" height="768"/>
<splash src="res/screens/ios/screen-ipad-land-2x.png" width="2048" height="1536"/>
<splash src="res/screens/ios/screen-iphone-portrait-568h-2x.png" width="640" height="1136"/>
<splash src="res/screens/ios/screen-iphone-land-568h-2x.png" width="1136" height="640"/>
<splash src="res/screens/ios/screen-iphone-portrait-667h.png" width="750" height="1334"/>
<splash src="res/screens/ios/screen-iphone-land-667h.png" width="1334" height="750"/>
<splash src="res/screens/ios/screen-iphone-portrait-736h" width="1242" height="2208"/>
<splash src="res/screens/ios/screen-iphone-land-736h.png" width="2208" height="1242"/>
</platform>
<platform name="windows">
<!-- images are determined by width and height. The following are supported -->
<splash src="res/screens/windows/splashscreen.png" width="620" height="300"/>
<splash src="res/screens/windows/splashscreenphone.png" width="1152" height="1920"/>
</platform>
<platform name="wp8">
<!-- images are determined by width and height. The following are supported -->
<splash src="res/screens/wp8/SplashScreenImage.jpg" width="768" height="1280"/>
<splash src="res/screens/wp8/SplashScreenImageland.jpg" width="1280" height="768"/>
</platform>
<!--PREFERENCES-->
<preference name="SplashScreenDelay" value="3000" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="SplashShowOnlyFirstTime" value="true" />
<!-- ICONS -->
<platform name="android">
<icon src="res/icons/android/icon-36-ldpi.png" density="ldpi" />
<icon src="res/icons/android/icon-48-mdpi.png" density="mdpi" />
<icon src="res/icons/android/icon-72-hdpi.png" density="hdpi" />
<icon src="res/icons/android/icon-96-xhdpi.png" density="xhdpi" />
</platform>
<platform name="ios">
<!-- iOS 8.0+ -->
<!-- iPhone 6 Plus -->
<icon src="res/icons/ios/icon-60-3x.png" width="180" height="180" />
<!-- iOS 7.0+ -->
<!-- iPhone / iPod Touch -->
<icon src="res/icons/ios/icon-60.png" width="60" height="60" />
<icon src="res/icons/ios/icon-60-2x.png" width="120" height="120" />
<!-- iPad -->
<icon src="res/icons/ios/icon-76.png" width="76" height="76" />
<icon src="res/icons/ios/icon-76-2x.png" width="152" height="152" />
<!-- iOS 6.1 -->
<!-- Spotlight Icon -->
<icon src="res/icons/ios/icon-40.png" width="40" height="40" />
<icon src="res/icons/ios/icon-40-2x.png" width="80" height="80" />
<!-- iPhone / iPod Touch -->
<icon src="res/icons/ios/icon.png" width="57" height="57" />
<icon src="res/icons/ios/icon-2x.png" width="114" height="114" />
<!-- iPad -->
<icon src="res/icons/ios/icon-72.png" width="72" height="72" />
<icon src="res/icons/ios/icon-72-2x.png" width="144" height="144" />
<!-- iPhone Spotlight and Settings Icon -->
<icon src="res/icons/ios/icon-small.png" width="29" height="29" />
<icon src="res/icons/ios/icon-small2x.png" width="58" height="58" />
<!-- iPad Spotlight and Settings Icon -->
<icon src="res/icons/ios/icon-50.png" width="50" height="50" />
<icon src="res/icons/ios/icon-50-2x.png" width="100" height="100" />
</platform>
<platform name="wp8">
<icon src="res/icons/wp/ApplicationIcon.png" width="99" height="99" />
<!-- tile image -->
<icon src="res/icons/wp/Background.png" width="159" height="159" />
</platform>
<platform name="windows">
<icon src="res/icons/windows/logo.png" width="150" height="150" />
<icon src="res/icons/windows/smalllogo.png" width="30" height="30" />
<icon src="res/icons/windows/storelogo.png" width="50" height="50" />
</platform>

After deeeeeep concentration I create.
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Android:
1. You are missing the larger dimensions
2. You can't use a 'density' attribute with qualifiers for values.
See the Icons and Splashscreens section of the PGB Docs

iOS:
Seems OK. Make sure your images have the exact dimensions. Make sure the paths are correct (as stored in your zip). Make sure you have at least the required icons and splashes as per Apple dev documentation

Windows:
Only two splashes, one landscape (small) and one portrait (large). Is that correct?

You have
<preference name="AutoHideSplashScreen" value="true" />
Are you sure you want your splashes automatically dismissed after 3 seconds, no matter whether the first page isn't ready for display yet, or has been ready for 2 seconds already?

Do you have the splashscreen plugin specified?
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes

Android:
1. You are missing the larger dimensions
2. You can't use a 'density' attribute with qualifiers for values.

1.larger dimension for icons or splash screens ?
2. So, I must remove density attributes?

iOS:
Seems OK. Make sure your images have the exact dimensions. Make sure the paths are correct (as stored in your zip). Make sure you have at least the required icons and splashes as per Apple dev documentation

Yes, i made sure the paths and icons/splashes names at my source folder.
what are the Apple dev documentation?


You have

Are you sure you want your splashes automatically dismissed after 3 seconds, no matter whether the first page isn't ready for display yet, or has been ready for 2 seconds already?

So I should remove it too? I thougt like games and other applications it should hide after few seconds.

Do you have the splashscreen plugin specified?

Yes I have already specified this plugin:
<plugin name="cordova-plugin-splashscreen"/>
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
1.larger dimension for icons or splash screens ?
2. So, I must remove density attributes?
1. Yes, larger dimensions
2. Yes. Like I said: See the Icons and Splashscreens section of the PGB Docs

I thougt like games and other applications it should hide after few seconds.
How do you know that these games dismiss the splashscreen after a fixed number of seconds?
Think again: suppose your cordova.js hasn't fired 'deviceready' after 3 seconds yet and the page isn't ready to display. Do you really still want to dismiss the splashscreen already?
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
Ok i got it now all.
Petra, I used now large dimensions see:

<platform name="android">
<icon src="res/icons/android/icon-36-ldpi.png"/>
<icon src="res/icons/android/icon-48-mdpi.png"/>
<icon src="res/icons/android/icon-72-hdpi.png"/>
<icon src="res/icons/android/icon-96-xhdpi.png"/>
<icon src="res/icons/android/icon-144-xxhdpi.png"/>
<icon src="res/icons/android/icon-192-xxxhdpi.png"/>
</platform>

after build when i testing on my android phone, Its showing very small icon
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
So, which one is it showing, then? And what are the screen dimensions and dpi of your test device?
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
The smallest picture showing ldpi, My device's screen resolution is 1080 x 1920 pixels (~441 ppi pixel density). And also splash screen is appearing only when first time app is launching everytime not showing. And first time showing stretched. NOT GOOD :(
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
Dear Petra, Is this my coding correct for online/offline status?

<script type="text/javascript">
document.addEventListener("offline", onOffline, false);

function onOffline() {
alert('Please Check you Internet Connection');
}
document.addEventListener("online", onOnline, false);

function onOnline() {
// Handle the online event
}

</script>
?????
with plugin <plugin name="cordova-plugin-network-information"/>
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
1. Icons and splashes
a. If I understand an issue correctly, you should remove
<preference name="SplashShowOnlyFirstTime" value="true" />

b. Splashes will be stretched to fit. Thousands of different devices with different screens (including round and square screens) run Android, so unlike Apple there is no way to create a set of fitting splashes for all devices.
If you want to specify where such image should remain unstretched and what areas should be stretched, you must use a 9-patch png.

c. I can't imagine that Android picks the wrong icon to display. My guess is that your icons are incorrect.
Could you upload them to some public place and post the url here, so I can have a look at your images?

2. Online and offline
a. You have
function onOffline() {
alert('Please Check you Internet Connection');
}

function onOnline() {
// Handle the online event
}


So, you want an alert displayed when the user goes offline, while the current page remains active. The user can click 'OK' and the alert disappears. The active page remains visible. Is that really what you want?

If so, what is it that you want to happen when the user comes back online? I guess nothing, unless you want to confirm to him that he is back online again. In that case, you could place the confirmation in the onOnline function.
It would look a bit...errrm...amateuristic, though.

b. You also need to check the state of the network connection at the start of the app, because the online and offline events are only fired on a status change. So, you must make sure that the app has been online, otherwise your alert will never show when the app was, is and remains offline all the time.
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
-<preference name="SplashShowOnlyFirstTime" value="false" />
Yes I solved it by value false, Now it's showing everytime when we are launching app,
-And I also understood about offine and online events.
-Now I am coming back on Icons and Splashes problem again:

-Splashes are showing in landscape even we switch orientation portrait or Landscape.
see: at bottom
href="https://d2r1vs3d9006ap.cloudfront.net...">

the paths i checked they are correct and also picture names.
BUt i couldn't found large dimensions for splash screen, yes but i have add icons large dimensions.


-and icons is so mall see:
<a
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Could you upload them to some public place and post the url here, so I can have a look at your images?
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
in Android Device. version 5.1 screen resolution 1080x1920.
It was showing good, when I set an default icon for all platforms like:
<icon src="icon.png">But now I dont know y showing small icon. and also splash screen is good at landscape but at portrait orientation. Landscape picture showing.
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
mi 4i device, I also checked on Intex it was also hd screen but small icon
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Icons: I think it's because you have no 'qualifier' attribute in your 'icon' element (for Android). See the Icons and Splashscreens section of the PGB Docs.

Splashes: did you change the 'density' attribute?
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
Yes, Petra thank you much , the icon is little bit good.
I removed before 'density' attribute for splashes, but if I wiil add them again so which value i will give them? u said did u change that attribute, chnge with whom?
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
See the Icons and Splashscreens section of the PGB Docs.
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
Good Morning Petra, Yes I read first PGB docs. After I build app again to add density attribute, and give values according to docs. But before It was showing splash screen, after I build with density attribute, Now It is not showing the screen, just showing a gray screen and launch the app.

<platform name="android">
<!-- you can use any density that exists in the Android project -->
<splash src="res/screens/android/screen-hdpi-land.png" density="land-hdpi"/>
<splash src="res/screens/android/screen-ldpi-land.png" density="land-ldpi"/>
<splash src="res/screens/android/screen-mdpi-land.png" density="land-mdpi"/>
<splash src="res/screens/android/screen-xhdpi-land.png" density="land-xhdpi"/>
<splash src="res/screens/android/screen-hdpi-portrait.png" density="port-hdpi"/>
<splash src="res/screens/android/screen-ldpi-portrait.png" density="port-ldpi"/>
<splash src="res/screens/android/screen-mdpi-portrait.png" density="port-mdpi"/>
<splash src="res/screens/android/screen-xhdpi-portrait.png" density="port-xhdpi"/>
</platform>

Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
You can't use the density attribute in combination with a value that consists of multiple qualifiers.
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
How I can write for landscape?
I tried with ....density="land-ldpi".... But same result with it.
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
You can't use the density attribute in combination with a value that consists of multiple qualifiers.
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
Petra please explain Sir.
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
'density' is for density only. Not for compound qualifiers.

This might help:
https://github.com/phonegap/build/iss...
http://stackoverflow.com/questions/20...
http://stackoverflow.com/questions/16...

Also, I'm still not quite sure what the UI requirements are. Do you have a liquid, responsive layout for both portrait and landscape screen formats? Or could your client settle for one or the other?
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
Alhumdulillah, It's done after a long task, I used that your link(http://stackoverflow.com/questions/20... ) to solve the problem, and it's solved now. :)
-yes i am using responsive layout since beginning.
this is code:

<platform name="android">
<!-- you can use any density that exists in the Android project -->
<splash src="res/screens/android/screen-ldpi-portrait.png" density="ldpi" qualifier="port-ldpi"/>
<splash src="res/screens/android/screen-mdpi-portrait.png" density="mdpi" qualifier="port-mdpi"/>
<splash src="res/screens/android/screen-hdpi-portrait.png" density="hdpi" qualifier="port-hdpi"/>
<splash src="res/screens/android/screen-xhdpi-portrait.png" density="xhdpi" qualifier="port-xhdpi"/>
<splash src="res/screens/android/screen-xxhdpi-portrait.png" density="xxhdpi" qualifier="port-xxhdpi"/>
<splash src="res/screens/android/screen-xxxhdpi-portrait.png" density="xxxhdpi" qualifier="port-xxxhdpi"/>
<splash src="res/screens/android/screen-hdpi-land.png" density="hdpi" qualifier="land-hdpi"/>
<splash src="res/screens/android/screen-ldpi-land.png" density="ldpi" qualifier="land-ldpi" />
<splash src="res/screens/android/screen-mdpi-land.png" density="mdpi" qualifier="land-mdpi"/>
<splash src="res/screens/android/screen-xhdpi-land.png" density="xhdpi" qualifier="land-xhdpi"/>
<splash src="res/screens/android/screen-xxhdpi-land.png" density="xxhdpi" qualifier="land-xxhdpi"/>
<splash src="res/screens/android/screen-xxxhdpi-land.png" density="xxxhdpi" qualifier="land-xxxhdpi"/>
</platform>

I would like to pay a HUGE THANKS to you PETRA, you are really working here like an angel not only for me, for all complainants.
THANK YOU
Saba
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
Greetings for the day Petra Vrba,
I am in a trouble Sir,
-After I added online and offline events, My app didn't showing Static map image, Only map holder showing, Image is not loading. At laptop it's showing well,but not on mobile.On Mobile GPS is also open, network also opened, I also checked required plugin all are there.
-Secondly, my app is behaving abnormally when internet data is on.
-Even some time offline too, It's hanging at php pages loading, HTML pages opening nicely, but whenever opening 'Post Complain' or 'Check Complain Status' pages which are php scripted, they are loading late and some time hanging on loading image. And when it's going hang, everytime i try to open it's hang, once it's hang, and when I clear the cache/RAM and again launch app, It's work normally but static map still not loading.
:(
what is the solution Petra.
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
what is the solution Petra.
Solution? You need to find the cause, first. Then the solution is to remove the cause.

After I added online and offline events, My app didn't showing Static map image, Only map holder showing, Image is not loading.
While offline, a map can't be loaded from an external source, of course. Is that what you mean?

Secondly, my app is behaving abnormally when internet data is on.
How is it 'behaving abnormally'? What constitutes this abnormal behaviour? Under what OS and what version? Can it be reproduced, and if so, und what situation?

It's hanging at php pages loading
Then you have a server problem. PHP pages are not loaded in the client, are they?

but whenever opening 'Post Complain' or 'Check Complain Status' pages which are php scripted, they are loading late and some time hanging on loading
How are you posting the data? Do you use an xmlHttpRequest or do you make use of the FileTransfer methods?
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
Solution? You need to find the cause, first. Then the solution is to remove the cause.


Yes, causes i want to know.

While offline, a map can't be loaded from an external source, of course. Is that what you mean?

No, yes I know that It can't be load offline. I mean before It was showing map, but after I added offline/online script.The static map is not showing when network is available.

How is it 'behaving abnormally'? What constitutes this abnormal behaviour? Under what OS and what version? Can it be reproduced, and if so, und what situation?

Its going hang sometime. Sometime the loading gif image not spinning. It stopped at page load.

Then you have a server problem. PHP pages are not loaded in the client, are they?

Petra, when i upload my zip folder with Html, css, java scripts and php pages. It was successful build. Then I Installed apk file into mobile and when i checked the php pages were opened also with static map. I was also shocked but really they were opened.

How are you posting the data? Do you use an xmlHttpRequest or do you make use of the FileTransfer methods?

I am not posting data , I didn't start yet, server-client communication. It was just only at client side problems i shared.
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
No, yes I know that It can't be load offline. I mean before It was showing map, but after I added offline/online script.The static map is not showing when network is available.
So, you have a bug in your code. You need to find out where the code is failing.

Petra, when i upload my zip folder with Html, css, java scripts and php pages. It was successful build. Then I Installed apk file into mobile and when i checked the php pages were opened also with static map. I was also shocked but really they were opened.
Either miracles happen, or your PHP pages are simply displayed without the embedded PHP code being parsed and executed...
Anyway, why did you include PHP documents in your assets?
And of course it was successfully built. Those PHP documents were simply added to the assets directory and they merely clutter up the app. You could also add a Word document with a fairy tale, or a .httpconf file for a webserver.
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes
Hahah your examples are really funny and meaningful,


You could also add a Word document with a fairy tale, or a .httpconf file for a webserver.
Photo of Saba Rais

Saba Rais

  • 724 Posts
  • 3 Reply Likes

Anyway, why did you include PHP documents in your assets?

I am testing locally , so where i should keep php documents? u said
Client side: in your assets. Server-side: on a remote server, together with your database

But if i am testing on local server so where i should keep php script files?
or I should use first ajax calls? After I check other problem?

So, you have a bug in your code. You need to find out where the code is failing.

It means i am doing mistake in online/offline events because before it was showing map.