• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

My phone takes a lot of time to boot!

Daniel Fernandes

Android Enthusiast
Aug 20, 2016
535
699
Device: Panasonic Eluga Ray Max
Android: Marshmallow 6.0.1
Root status: Unrooted

So, this phone was fine for almost a year. But recently, when I had to reboot my phone (to change the SIM card, I do that every week), it took a long time to start. I get a message saying "Android is starting". Below that, it's written "Optimising App (1/1)".

I think we get the optimising app message each time the device gets a software update. That would be normal. But, I get this message every time I reboot the phone.

Although, after that message, Android does start. But it's an inconvenience because it takes about half an hour to complete.

I would like to know, what are the possible causes for this? And how do I stop it?

One thing I would like to add is that I got a lot of apps on this phone. Is that causing it?
 
Device: Panasonic Eluga Ray Max
Android: Marshmallow 6.0.1
Root status: Unrooted

So, this phone was fine for almost a year. But recently, when I had to reboot my phone (to change the SIM card, I do that every week), it took a long time to start. I get a message saying "Android is starting". Below that, it's written "Optimising App (1/1)".

I think we get the optimising app message each time the device gets a software update. That would be normal. But, I get this message every time I reboot the phone.

Although, after that message, Android does start. But it's an inconvenience because it takes about half an hour to complete.

I would like to know, what are the possible causes for this? And how do I stop it?

One thing I would like to add is that I got a lot of apps on this phone. Is that causing it?

Android devices has a tendency of doing that after it has been rooted and unrooted if that's your case, but you can also check and see if your phone has an update available. But I would just go into Settings then Apps and clean each of the apps caches out and see if that resolve the problem.
 
Upvote 0
Hello brother!, how are you?..hey actually my rooted §5 does that when I put it in recovery mode and first wipe cache and wipe dalvik..yes it takes about 10 minutes doing that optimization thing of each one of them(i guess I don't have that many apps as you have..I thought I was the champion..lol)..
So my suggestion try to do that to see if it continues doing it in the following boot(which it should've not been doing that for a regular boot)..
If it does..try to do a format reset(they aren't painful any more once you have your full back up)..
If still doing that I guess a firmware flash is in your nearest future..

Let me know.
 
Upvote 0
Now if you really what to know what's going on in your device you can try
keeping few things in mind we can improve the performance of our application. Following are the factors which degrade our app performance and the improvements which can be done.

Slow Rendering
Slow Rendering is the most common performance problem. Because what the the designers want from us and what we do, may not be the same and trying to do the best visuality, we can sometime fail in development.

Rendering is defined in terms of times which ensures that app is running Butterly smooth at a constant 60 FPS without any dropped or delayed frames.

What Causes Slow Rendering?
System tries to attempt redrawn your activities after every 16ms. This means that our app has to do all the logic to update the screen in that 16 ms.


0*rTrB52ppuXaMv9gy.

what if our app can’t complete the logic in 16 ms?


0*xyCHR4_24fID9cn_.

It’s called dropped frame. For example, if your calculation takes 24 ms, this case happens. System tried to draw a new picture to the screen, but it wasn’t ready. So it did not refresh anything. And this caused, user’s seeing the refreshed picture after 32 ms instead of 16ms. If even there is one dropped frame, the animation will start not to be seen smooth.

Following tools can be used to improve Rendering :
  1. Hierarchy Viewer
Hierarchy Viewer is a tool built into Android Device Monitor that allows you to inspect the properties and layout speed for each view in your layout hierarchy. It can help you find performance caused by the structure of your view hierarchy, helping you then simplify the hierarchy and reduce overdraw.

2. Profile GPU Rendering

Profile GPU Rendering gives a quick visual representation of how much time it takes to render the frames of a UI window relative to the 16-ms-per-frame benchmark.

Enable Profile GPU Rendering


0*t5DPyvwfqx6cW_yW.

On your mobile device, go to Settings > Developer Options.

  • In the Monitoring section, select Profile GPU Rendering.
  • In the Profile GPU Rendering popup, choose On screen as bars
  • Go to the app that you want to profile.
Visual Output of GPU Profiler

  • The horizontal axis shows time elapsing, and the vertical axis time per frame in milliseconds.
  • As you interact with your application, vertical bars show up on your screen.
  • Each vertical bar represents one frame of rendering.
  • The green line marks the 16 millisecond target. Every time a frame crosses the green line, app is missing a frame, and users may see this as stuttering images.
Application Launching Time
App launch can take place in one of two states, each affecting how long it takes for an application to become visible to user.

  1. Cold Start
  2. Warm Start
Cold Start

A cold start refers to an app’s starting from scratch, Cold starts happen in cases such as your app’s being launched for the first time since the device booted, or since the system killed the app.

At the beginning of a cold start, the system has three tasks. These tasks are:

  • Loading and launching the app.
  • Displaying a blank starting window for the app immediately after launch.
  • Creating the app process.
Warm Start

A warm start of your application is much simpler and lower-overhead than a cold start. In a warm start, all the system does is bring your activity to the foreground. If all of your application’s activities are still resident in memory, then the app can avoid having to repeat object initialisation, layout inflation, and rendering.

How to Resolve app launching Time delay?
  • Initialise only those objects that are immediately needed. For example, rather than creating global static objects, instead, move to a singleton pattern, where the app initialises the object for the first time it accesses them.
  • Flattening your view hierarchy by reducing redundant or nested layouts.
  • Move all resource initialisation so that the app can perform it lazily on a different thread.
  • Allow the app to load and display your views, and then later update visual properties that are dependent on bitmaps and other resources.
Layouts
Layouts are a key part of Android applications that directly affect the user experience. If poorly implemented, your layout can lead to a memory hungry application with slow UIs. Each widget and layout you add to your application requires initialisation, layout, and drawing. For example, using nested instances of LinearLayout can lead to an excessively deep view hierarchy.

How to Improve Layout Performance?
  1. Optimising Layout Hierarchies
Using the basic layout structures leads to the most efficient layouts. However, each widget and layout you add to your application requires initialisation, layout, and drawing. For example, using nested instances of LinearLayout can lead to an excessively deep view hierarchy. Furthermore, nesting several instances of LinearLayout that use the layout_weight parameter can be especially expensive as each child needs to be measured twice. This is particularly important when the layout is inflated repeatedly, such as when used in a ListView or GridView.

2. Re-using Layout with <Layouts>

Reusing layouts is particularly powerful as it allows you create reusable complex layouts. For example, a yes/no button panel, or custom progress bar with description text. It also means that any elements of your application that are common across multiple layouts can be extracted, managed separately, then included in each layout. So while you can create individual UI components by writing a custom View, you can do it even more easily by re-using a layout file.

3. Loading Views on Demand

Sometimes your layout might require complex views that are rarely used. Whether they are item details, progress indicators, or undo messages, you can reduce memory usage and speed up rendering by loading the views only when they are needed.

Power Usage
Battery Usage Reduction is also an important part of an android development as this optimisation will ultimately lead to retain the user, as many times the user uninstall the application because of the battery draining issue.

Tips for improving battery usage in an android application:
  • Reduce network calls as much as you can.
  • Avoid wake lock as much as Possible.
  • Use GPS carefully.
  • Use Alarm manager carefully.
  • Perform Batch Scheduling.
 
Upvote 0
So my suggestion try to do that to see if it continues doing it in the following boot

Yes, it does it every time I boot.

The strange thing is that it only says "Optimizing app 1 of 1" for half an hour. That means that it's only optimizing one app. I have tried clearing system cache but with no success.

I don't want to go for a factory reset yet. Because there is too much data that I'll have to backup and there are some apps that I'm sure will never get restored (long story).

This phone is very unpopular. And so, it doesn't have any firmware available. I've searched for it many times and I never found it. I did find it for other Panasonic phones though, so it means that they did not release the firmware on their site.

This phone came with vanilla Android (means no apps from OEM). Except for one. Which is some kind of an assistant (I don't use it), and this app was available after the phones first (and only) OTA update. Maybe that's the app it is optimizing all the time?
 
Upvote 0
Now if you really what to know what's going on in your device you can try
keeping few things in mind we can improve the performance of our application. Following are the factors which degrade our app performance and the improvements which can be done.

Slow Rendering
Slow Rendering is the most common performance problem. Because what the the designers want from us and what we do, may not be the same and trying to do the best visuality, we can sometime fail in development.

Rendering is defined in terms of times which ensures that app is running Butterly smooth at a constant 60 FPS without any dropped or delayed frames.

What Causes Slow Rendering?
System tries to attempt redrawn your activities after every 16ms. This means that our app has to do all the logic to update the screen in that 16 ms.


0*rTrB52ppuXaMv9gy.

what if our app can’t complete the logic in 16 ms?


0*xyCHR4_24fID9cn_.

It’s called dropped frame. For example, if your calculation takes 24 ms, this case happens. System tried to draw a new picture to the screen, but it wasn’t ready. So it did not refresh anything. And this caused, user’s seeing the refreshed picture after 32 ms instead of 16ms. If even there is one dropped frame, the animation will start not to be seen smooth.

Following tools can be used to improve Rendering :
  1. Hierarchy Viewer
Hierarchy Viewer is a tool built into Android Device Monitor that allows you to inspect the properties and layout speed for each view in your layout hierarchy. It can help you find performance caused by the structure of your view hierarchy, helping you then simplify the hierarchy and reduce overdraw.

2. Profile GPU Rendering

Profile GPU Rendering gives a quick visual representation of how much time it takes to render the frames of a UI window relative to the 16-ms-per-frame benchmark.

Enable Profile GPU Rendering


0*t5DPyvwfqx6cW_yW.

On your mobile device, go to Settings > Developer Options.

  • In the Monitoring section, select Profile GPU Rendering.
  • In the Profile GPU Rendering popup, choose On screen as bars
  • Go to the app that you want to profile.
Visual Output of GPU Profiler

  • The horizontal axis shows time elapsing, and the vertical axis time per frame in milliseconds.
  • As you interact with your application, vertical bars show up on your screen.
  • Each vertical bar represents one frame of rendering.
  • The green line marks the 16 millisecond target. Every time a frame crosses the green line, app is missing a frame, and users may see this as stuttering images.
Application Launching Time
App launch can take place in one of two states, each affecting how long it takes for an application to become visible to user.

  1. Cold Start
  2. Warm Start
Cold Start

A cold start refers to an app’s starting from scratch, Cold starts happen in cases such as your app’s being launched for the first time since the device booted, or since the system killed the app.

At the beginning of a cold start, the system has three tasks. These tasks are:

  • Loading and launching the app.
  • Displaying a blank starting window for the app immediately after launch.
  • Creating the app process.
Warm Start

A warm start of your application is much simpler and lower-overhead than a cold start. In a warm start, all the system does is bring your activity to the foreground. If all of your application’s activities are still resident in memory, then the app can avoid having to repeat object initialisation, layout inflation, and rendering.

How to Resolve app launching Time delay?
  • Initialise only those objects that are immediately needed. For example, rather than creating global static objects, instead, move to a singleton pattern, where the app initialises the object for the first time it accesses them.
  • Flattening your view hierarchy by reducing redundant or nested layouts.
  • Move all resource initialisation so that the app can perform it lazily on a different thread.
  • Allow the app to load and display your views, and then later update visual properties that are dependent on bitmaps and other resources.
Layouts
Layouts are a key part of Android applications that directly affect the user experience. If poorly implemented, your layout can lead to a memory hungry application with slow UIs. Each widget and layout you add to your application requires initialisation, layout, and drawing. For example, using nested instances of LinearLayout can lead to an excessively deep view hierarchy.

How to Improve Layout Performance?
  1. Optimising Layout Hierarchies
Using the basic layout structures leads to the most efficient layouts. However, each widget and layout you add to your application requires initialisation, layout, and drawing. For example, using nested instances of LinearLayout can lead to an excessively deep view hierarchy. Furthermore, nesting several instances of LinearLayout that use the layout_weight parameter can be especially expensive as each child needs to be measured twice. This is particularly important when the layout is inflated repeatedly, such as when used in a ListView or GridView.

2. Re-using Layout with <Layouts>

Reusing layouts is particularly powerful as it allows you create reusable complex layouts. For example, a yes/no button panel, or custom progress bar with description text. It also means that any elements of your application that are common across multiple layouts can be extracted, managed separately, then included in each layout. So while you can create individual UI components by writing a custom View, you can do it even more easily by re-using a layout file.

3. Loading Views on Demand

Sometimes your layout might require complex views that are rarely used. Whether they are item details, progress indicators, or undo messages, you can reduce memory usage and speed up rendering by loading the views only when they are needed.

Power Usage
Battery Usage Reduction is also an important part of an android development as this optimisation will ultimately lead to retain the user, as many times the user uninstall the application because of the battery draining issue.

Tips for improving battery usage in an android application:
  • Reduce network calls as much as you can.
  • Avoid wake lock as much as Possible.
  • Use GPS carefully.
  • Use Alarm manager carefully.
  • Perform Batch Scheduling.
I think you wanted to send that on another thread? ;-)
 
Upvote 0
I gave you a like anyways, but I think that you wanted to post that on the Android Development sub forum?

Thanks but I only accept honors people think I deserve. But the method can be used by any one that wants to know what's going on with their device applications and also for developers applications. So as far as the questioner issue with his device, he can also locate the slow rendering apps with this same method. So to some degree this method can be used for multiple platforms.
 
Upvote 0
Thanks but I only accept honors people think I deserve. But the method can be used by any one that wants to know what's going on with their device applications and also for developers applications. So as far as the questioner issue with his device, he can also locate the slow rendering apps with this same method. So to some degree this method can be used for multiple platforms.
I didn't ask for slow rendering of any apps... Really...
 
Upvote 0
Apparently there's one particular app that's creating this problem at startup. Determining just which one is going to be an issue. If you do something like a Factory Reset, or flash the ROM, that may solve the problem from an overall sense but it won't tell you which app started this problem to begin with. (...and I doubt flashing the ROM applies to this problem, that's a matter pertaining to the operating system, this appears to be just a problematic app or possibly a corrupt update to an app.)
If you think back to when you first noticed this 'Optimizing App (1/1)' issue when you start your phone, can you recall if you also installed any app just previous to this? Or if you start up your 'Play Store' app, go into the 'My apps & games' menu, and look at the 'Installed' column. If you click on each app entry, then the 'Read More' link, scroll to the bottom for the 'Updated on' date info. Is there an app that was updated around that time this startup problem started to occur?
 
Upvote 0
Apparently there's one particular app that's creating this problem at startup. Determining just which one is going to be an issue. If you do something like a Factory Reset, or flash the ROM, that may solve the problem from an overall sense but it won't tell you which app started this problem to begin with. (...and I doubt flashing the ROM applies to this problem, that's a matter pertaining to the operating system, this appears to be just a problematic app or possibly a corrupt update to an app.)
If you think back to when you first noticed this 'Optimizing App (1/1)' issue when you start your phone, can you recall if you also installed any app just previous to this? Or if you start up your 'Play Store' app, go into the 'My apps & games' menu, and look at the 'Installed' column. If you click on each app entry, then the 'Read More' link, scroll to the bottom for the 'Updated on' date info. Is there an app that was updated around that time this startup problem started to occur?
Yes, I had installed Clash Of Clans. But I'd not expect that to cause any problems. Right?

However, I didn't install it from Play Store. I took it from a friend using SHAREit, and at that time I had to turn on the "unknown sources" option....

Which reminds me that I have to turn it off now... :p

So, if a factory reset can solve the problem then does it mean that something is wrong with my installed apps?

I had updated a lot of apps a day before that. About 20 of them. Do you want me to list all of them?

Oh and by the way, that "assistant" app by Panasonic has an update available on Play Store. Will it be wise to update it?
 
Upvote 0
A Factory Reset wipes the data partition, where your files and where your installed apps and their respective config data are stored. It doesn't affect the operating system, nor any carrier installed system apps. So by doing a FR you're wiping all your installed apps, the issue being once you restore everything you might also be restoring your 'Optimizing.....' problem. Or things might be fine as that optimizing an app problem could be due to just a one-off problem during the install or while applying an app update.
So it boils down to a something of a mess. Spend time trying to determine just which app you've installed in causing the problem, or do a FR then restore everything on the hope this solves the problem. If a FR does fix things, great but if not then you'll still have to go through all your installed apps and determine just which one is the problem.
 
  • Like
Reactions: Daniel Fernandes
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones