Very slow on android devices


#1

I am using Ionic (2) and have built a very simple app that recieves JSON from an API and renders each object into an ion-card component inside of an ion-scroll. At any one time there is at most 30 cards on the page. The only other content to load is some built in images which I optimised their file size.

Now, the navigation moving from page to page on android is painfully slow, probably 15-20 seconds after clicking a link. This does not occur on IOS at all.

I have tried the debug and production release apk’s aswell as viewing through ionics app.

Does anybody have any ideas, surely the hardware can not be this slow.

Thanks


#2

A lot of things could be happening. As a first step, you might try installing Crosswalk to see if that smooths out your Android experience. If you’re on Android 4 though, that isn’t supported, so I hope you’re talking about at least Android 4.x. But if you want more specific advice, you need to give more specific information.


#3

Thank you very much for your response. I have installed crosswalk and generated the apk, I do notice a slight improvement but is still much slower than I would hope. I am targeting an Acer Iconia One 10, which has ARM 7 architecture. It is running version 6.0 of android. Would you have any other suggestions? This is the first time I have deployed to android so please forgive my naivety.

Thanks again Aaron!

Callum


#4

Are you loading data in the constructor or in a lifecycle event such as ionViewWillEnter?

I’ve noticed that loading data directly in the constructor can cause it to load slowly…although I’ve never seen it take 15-20 seconds to load.


#5

As @SigmundFroyd points out, there are code sins you might be committing that would cause Ionic to process a lot before pushing a new page. But that wouldn’t explain the big difference in time between Android and iOS. Debug on a real device with Chrome Inspector. There might be a whitelist issue. Also, the problem might lie with Cordova plugins, not your Typescript code. So there’s potentially a lot to chase down. But simplest first steps are probably: (1) use Chrome Inspector, and (2) get all heavy lifting out of your page constructors.