Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App works slow after initializing the map on Android #261

Closed
starostin opened this issue Oct 20, 2014 · 37 comments
Closed

App works slow after initializing the map on Android #261

starostin opened this issue Oct 20, 2014 · 37 comments

Comments

@starostin
Copy link

Hello. I have some problem in Android. After initializing map my application starts work very slow. All css animations and transactions.
On version 1.1.2 everything was ok, but on 1.2.2 it is happened. Is there any solution? I have tried to remove the map each time, when I detach the view, but it does not help( Can you suggest anything, please

@starostin starostin changed the title App works slow after initializing the map App works slow after initializing the map on Android Oct 20, 2014
@wf9a5m75
Copy link
Member

Some people reports similar this case, but I can not reproduce the same issue.
I think the webview(browser view) of Android is related with this issue.
What Android device and Android version do you use?
Could you show me the screen capture of "system settings > About phone"?

@starostin
Copy link
Author

Nexus 7 2, android 4.4.4. Weird that on old version everything worked well

@starostin
Copy link
Author

And on Nexus 7 some transitions even does not work at all (

@wf9a5m75
Copy link
Member

Um, that's weird. I usually tested on Nexus 7 (2012), but there is no issue.
Do you use any other plugin with this plugin?

@wf9a5m75
Copy link
Member

And do you use the ionic framework or something?

@starostin
Copy link
Author

I use a lot plugins, we develop a big app. No, I don't use ionic. We use backbone

@wf9a5m75
Copy link
Member

Could you tell me what plugins do you use?

@starostin
Copy link
Author

Is the reason could be in other phonegap plugins?

@starostin
Copy link
Author

android.support.v4 1.0.0 "Android Support v4"
co.themobilefirm.FlurryPlugin 3.3.6 "Flurry SDK"
com.google.playservices 17.0.0 "Google Play Services for Android"
com.googlemaps.ios 1.8.1 "Google Map iOS SDK for Cordova"
com.jcesarmobile.IDFVPlugin 1.0.0 "Identifier For Vendor Plugin"
com.phonegap.plugins.PushPlugin 2.2.0 "PushPlugin"
com.phonegap.plugins.sqlite 0.7.0 "SQLitePlugin"
com.phonegap.plugins.videoplayer 1.0 "VideoPlayer"
com.plugin.datepicker 0.3.0 "Datepicker"
de.appplant.cordova.plugin.email-composer 0.8.2dev "EmailComposer"
nl.x-services.plugins.calendar 4.2.3 "Calendar"
org.apache.cordova.camera 0.2.9 "Camera"
org.apache.cordova.console 0.2.8 "Console"
org.apache.cordova.device 0.2.9 "Device"
org.apache.cordova.file 1.0.1 "File"
org.apache.cordova.file-transfer 0.4.2 "File Transfer"
org.apache.cordova.geolocation 0.3.10 "Geolocation"
org.apache.cordova.network-information 0.2.10-dev "Network Information"
org.apache.cordova.splashscreen 0.3.1 "Splashscreen"
plugin.google.maps 1.2.2 "phonegap-googlemaps-plugin"
plugin.http.request 1.0.0 "phonegap-http-request"

@wf9a5m75
Copy link
Member

Thank you. I will check those plugins tonight.

@starostin
Copy link
Author

Thank you very much)

@wf9a5m75
Copy link
Member

Oh, could you help me one more thing?
Because of you are using Android 4.4.4, you can record the screen capture as video, and I haven't reproduced this issue yet.
In order to confirm the issue, could you take a video then upload to the youtube?

@starostin
Copy link
Author

I can try

@wf9a5m75
Copy link
Member

Thank you for your help.

I added some code to improve the webview performance generally.
Try the plugin on the test branch.

$> cordova plugin add https://github.com/wf9a5m75/phonegap-googlemaps-plugin#test --variable ...

@starostin
Copy link
Author

I have replaced GoogleMaps.java, but it is still slow(

@wf9a5m75
Copy link
Member

I see.

@wf9a5m75
Copy link
Member

@starostin
Copy link
Author

I have already at home, so I will check it tomorrow. Thanks

@wf9a5m75
Copy link
Member

Ok.
On Oct 20, 2014 12:04 PM, "starostin" notifications@github.com wrote:

I have already at home, so I will check it tomorrow. Thanks


Reply to this email directly or view it on GitHub
#261 (comment)
.

@starostin
Copy link
Author

No, it is still slow

@starostin
Copy link
Author

Seems I have found the problem. There two lines with
webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
if comment them, everything works ok)

@wf9a5m75
Copy link
Member

I added them today.
On Oct 20, 2014 11:43 PM, "starostin" notifications@github.com wrote:

Seems I have found the problem. There two lines with
webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
if comment them, everything works ok)


Reply to this email directly or view it on GitHub
#261 (comment)
.

@starostin
Copy link
Author

But after commenting this lines screen with map blinks after first opening

@starostin
Copy link
Author

they are on GoogleMaps.java line 175, and MyPluginLayout.java line 56

@starostin
Copy link
Author

Is there any solutions to avoid blinks?)

@michaeleparkour
Copy link

Really can confirm that overriding to Software mode slows app. But if just comment these lines - map blinks on creating and even with wrong sizes, and refreshLayout() doesn't helps.

@wf9a5m75
Copy link
Member

webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

The above line needs to place the map under the browser view.
Because some Android webview does not change the opacity without this specify.

@starostin
Copy link
Author

It is sad. But for me better blinks than slow app(

@wf9a5m75
Copy link
Member

Ok, how about the remove android:hardwareAccelerated="true" from the AndroidManifest.xml file?

@starostin
Copy link
Author

I will try, but I thought without this my app become slower, or no?

@wf9a5m75
Copy link
Member

I don't know.
I haven't reproduced the slower situation even if I use Nexus 7 2012 model with Android 4.4.4 (old one than yours).

@starostin
Copy link
Author

It did not help( Thank you for attention)

@wf9a5m75
Copy link
Member

@starostin

Add android:largeHeap="true" attribute into <application> tag in the ApplicationManifest.xml file under the platforms/android/

The plugin can not add this attribute automatically, so please add by hand.

android:largeHeap="true" allows large heap memory allocation.

I don't know this helps to solve your case, but the issue #224, which is similar case with yours, is effected at least for me.

If this does not help, please share your project with me using github.
I will investigate yours.

@wf9a5m75
Copy link
Member

@starostin Any update?

@starostin
Copy link
Author

Sorry, was not at work. I set android:largeHeap="true", but it did not help. A cant share project, because it is not my project( I will create new one, and then give you an access

@wf9a5m75
Copy link
Member

wf9a5m75 commented Nov 3, 2014

@starostin Thank you, I'll be waiting.

@wf9a5m75
Copy link
Member

wf9a5m75 commented Nov 5, 2014

Since there is no new information, I close this issue at once.
However you can still discuss for this.
If you have a new information, please let me know through this thread.

@wf9a5m75 wf9a5m75 closed this as completed Nov 5, 2014
@wf9a5m75 wf9a5m75 added this to the Need more infomation milestone Nov 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants