AndroidStudio Freeze while working on UI - android

In the last couple of days, my AndroidStudio suddenly freezes while working on the UI. It's simply freezes and even if I wait for 10 minutes it won't resume itself and the only thing I can do is to terminate the process through task manager and start the Studio again.
I checked for updated to the AndroidStudio thinking this might help so I did the update and my current version is:
But even after the update - it's still happens after about 5 minutes of work on the UI.
I took a screen shout of task manager after the freeze happened and it doesn't seem like it happens due to some overload on the system , here's the screenshot:
I searched the forum before posting but I didn't find any post that described the same problem as I have.
I continued exploring my problem in order to make it more specific and fount out that it's only freezes when I'm trying to use the extract resource window in order to make my views name by the String.xml instead of direct writing the value to the text field of each view.
This is the extract resource window I'm talking about.
I hope it will make it easier for you to understand my problem and help me with a solution.
Thank you in advance,
Noam

Related

Android Studio's review layout did not show text. Why this happen?

This problem happen after android studio suddenly close itself. I feel relieve when i see the interface output can show it's text but, it annoy me when i try to codes the interface and there is no text shown there. How can i solve this problem and what make this problem occur?
I already solve this problem by use the new render layout. I kind a hesitate to use it at first because i have face this problem before and it is also render problem. No matter how many time i change my codes according to suggestion and change the render layout. Still nothing works. I need start from scratch because i can't find the solution. But this time it's work.

Xamarin Android app built using MvvmCross stuck on splash screen when resumed from background after 3-4 days

I am working on one Xamarin Android project which is using MvvmCross version 3.5.1. I am facing one issue which we thought might be because of MvvmCross set up failure. App is basically for both platforms Android and iOS. But, i am facing an issue specifically for Android. App is quite old and in development from last 3-4 years and never upgraded to latest released versions of MvvmCross. Updating MvvmCross is last option for me. But before that I want to fix this issue by knowing it's root cause and way to reproduce it.
Scenario:
1) App installed on Android device, Login is done.
2) App moved to background.
3) After 3-4 days, app resumed by clicking on app launcher
icon and stuck on splash screen.
4) App started working again when
force stop from phone setting
I am unable to reproduce this issue without putting it in the background for more than 3-4 days. Can you please suggest a few approaches to know the root cause and steps to reproduce this issue without putting the app in background for more than 4 days.
Below Logs printed from MvvmCross and app freezes on the splash screen. log statement in bold "No view model type finder available - assuming we are looking for a splash screen - returning null" is printed 3-4 times and then app stuck on splash screen. Even though app stuck on splash screen. push notifications are received by an application.
Setup: PlatformServices start"
Setup: MvvmCross settings start"
Setup: Singleton Cache start"
"mvx": "No view model type finder available - assuming we are looking for a splash screen - returning null"
"mvx": "No view model type finder available - assuming we are looking for a splash screen - returning null"
"mvx": "No view model type finder available - assuming we are looking for a splash screen - returning null"
Please help me to know why the above log statement in bold is getting printed for 3-4 times and why logs from _setup.InitializeSecondary() are not printed, and then app stucks on splash. Looks like setup hung in between because of some deadlock or race condition. It will really help me if you have any suggestions to know possibilities to know the root cause and a way to reproduce this issue. Thanks in advance.
Updated:
We are able to reproduced this scenario by commenting InitializeSecondary() call from MvxAndroidSetupSingleton->InitializeFromSplashScreen() and app stuck on Splash screen. please suggest fixing this splash screen stuck from app level code. Basically, we don't want to modify MvvmCross code and wanted to fix from app code. Your help is appreciated. As per logs, a line of code _setup.InitializeSecondary(); in below method from MvxAndroidSetupSingleton.cs is not executed. This issue is getting reproduced only after keeping the application in the background for more than 4-5 days. First i am trying to know why this is happening in this particular case and then solution for it. Thanks in advance
Note: I am using Android Foreground service in my application
public virtual void InitializeFromSplashScreen(IMvxAndroidSplashScreenActivity splashScreen)
{
lock (LockObject)
{
_currentSplashScreen = splashScreen;
if (_initializationStarted)
{
if (_initialized)
{
_currentSplashScreen.InitializationComplete();
return;
}
return;
}
_initializationStarted = true;
}
_setup.InitializePrimary();
ThreadPool.QueueUserWorkItem(ignored =>
{
_setup.InitializeSecondary();
lock (LockObject)
{
_initialized = true;
if (_currentSplashScreen != null)
_currentSplashScreen.InitializationComplete();
}
});
}
We have made a lot of improvements to app startup in MvvmCross. So chances are that your issue has been solved in a newer version.
Although, since it is saying "No view model type filder available", it will probably mean that the startup procedure hasn't finished or is stuck doing something and cannot find the next ViewModel it wants to continue to.
Android will memory clear an app if it is long in the background and or unused. This means that the mvvm framework loses all of its references in memory as the same for your IOC Container. Normally an mvvm framework should be able to handle this but in my experience sometimes you have to manually give it a push.

Xamarin Studio contenues to freeze when trying to open an .axml file, and other .axml bugs

So this problem is happening to me a ton and I can't believe there is not a mention of others having the same issue on the interwebs. In the course of working with Xamarin Android axil files, often I will double click one in the solutions pane and XS will stick , showing "Opening xxxxxxxxxxx.axml". The only way to get out of it is to restart XS. Right now I am doing some work that requires a single line alteration on about 30 different axml files and I have had this happen 9-10 times in the last 20 minutes. I have also had this bug happen on multiple Macs, with (obviously) separate installs of XS and it has been an issue for months. I am getting to my wits end.
On top of the above bug, I also get one that will prevent an edited axml from saving changes. So I will do a bunch of work on one, save it, close the tab out, and then open it again only to find that all the changes were not saved. I am to the point now that I have to select all, copy, close the file, open it, select all, paste and then save again, just to get my edits to save. I have lost SO MUCH time and work because of these bugs.
Is anyone having a similar experience? How can they be fixed?

Automated Testing in Lollipop - waitForIdleSync stuck forever

Ever since I started using one of the newer devices from Google for testing, my tests have gotten stuck whenever we call waitForIdleSync(). When going over the documentation for espresso for another reason, I found this amazing tidbit: "To avoid flakiness, we highly recommend that you turn off system animations". See the main page and how to do it programmatically.
However, I've followed the instructions (disable animations and restart my device) and my tests are still getting stuck. Google's documentation has a habit of getting stale fast, so, is there something else I need to do to get this working on newer devices?
I have the same issue and it broke our tests completely for the last two days.
Problem
I researched this issue a lot. In fact it is an AOSP bug: https://code.google.com/p/android/issues/detail?id=82046
(re-opened from this https://code.google.com/p/android/issues/detail?id=61111)
The problem occurs when you have a a animation, loading spinner, progressbar etc. in your Activity/ Layout that runs for a long time.
waitForIdleSync() will therefore wait forever.
In our case it is very problematic, because the methods getActivity(),launchActivity() and launchActivityWithIntent() of ActivityInstrumentationTestCase2and also the new AndroidTestCase have waitForIdleSync() inside.
Solution Suggestions
You can try turning the animations off or set the Visibility of any ProgressSpinner to GONE via an Intent Flag and start it with that. (Personally, I don't like that solution as it would affect the Activity itself and not the Testcode)
Another way would be to mock the preconditions for the Activity to let it not fall into this state.
Other suggestions are welcome!

Show progress of file sending

Im sending files to my server from my android device, and would be great to get some feedback on how the file process is working out. For example in percentage.
Just that im leaving home for a couple of days and i would like to get right on it when i get back home becuase my time is running out. So would be great to return home with some descent tips right away :)
I think the following link has exactly the codes that you are looking for. A sample application that shows the progress of downloading a file:
http://www.java-samples.com/showtutorial.php?tutorialid=1521
There are 2 ways to do it:
Use a Handler
Use an AsyncTask

Categories

Resources