Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Thursday, April 7, 2022

Failed to start Android Studio on Windows

Android Studio refuses to start due to the error,


Internal error. ...

java.util.concurrent.CompletionExecution: java.net.BindExcetion: Address already in use: bind
...

Apparently, Windows sometimes does release TCP ports completely for some reason, and the solution is to restart the winnat service. 

  1. Open Windows Command Prompt as an Administrator 
  2. Run the following to stop and restart winnat service
    net stop winnat
    net start winnat
    

Alternatively, open PowerShell as an Administrator, and run


Restart-Service -Name winnat

Thursday, March 24, 2022

Stopping Android Emulator From Command Line

To stop all Android emulator instance, we do,


adb emu kill

If we want to kill a specific Android emulator instance, we need to find out the device's serial number or identifier. For this, we do,


adb devices

The typical emulator serial number or identifier is emulator-5554. Using this as an example, we can kill the emulator instance using the command below,


adb -s emulator-5554 emu kill

Sunday, October 16, 2016

Flashed Android Phone Staying in Boot Animation Cycle

I have an old HTC EVO 4G LTE Android phone. It is dubbed code name "jewel". I was flashing it with a CyanogenMod custom ROM following the instruction on CyanogenMod's website. However, once I finished the flashing process, and the phone stays in boot animation cycle, i.e., it would boot into the HTC logo, and the screen would turn dark, and the process repeats.

It turns out the boot image was not installed properly. To fix it, extract the boot.img from the custom ROM zip file, and upload the boot image to the phone, and boot the phone into fastboot mode, and run the following command,

fastboot flash boot boot.img

This procedure is discussed in an xda-developers.com thread.

Wednesday, March 2, 2016

Yahoo Calendar on Mozilla Thunderbird with Lightning and on Android Devices

I have had plenty of difficulties to put Yahoo Calendar on Mozilla Thunderbird with Lightning and on Android Devices.

If you still want to use Yahoo! Calendar and have difficulties to put it on Mozilla Thunderbird and on Android Devices. This post may be helpful to you.

Yahoo! Calendar on Thunderbird


It appears straightforward to put Yahoo Calendar on Thunderbird. As documented in Mozilla documentation entitled "Thunderbird and Yahoo" and  Yahoo documentation entitled "Sync Yahoo Calendar with Mozilla Lightning", it appears that it is well established that Thunderbird with Lightning add-on should work with Yahoo Calendar.

However, you may notice two issues.
  • If you follow Yahoo's instruction in  "Sync Yahoo Calendar with Mozilla Lightning" to use  iCalendar as the means to access Yahoo Calendar on Thunderbird with Lightning, you only get read access, that is, you cannot create or change any events in Yahoo Calendar on Thunderbird with Lightning. Therefore, a better approach is to use Yahoo CalDAV services as instructed in "Sync Yahoo Calendar on Multiple Devices". However, the Yahoo CalDav URL is actually in the following format,
    
    https://caldav.calendar.yahoo.com/dav/YOUR_USERNAME/Calendar/YOUR_CALENDARNAME 
    


  • If you set up Lightning to access Yahoo Calendar via its CalDAV service, you may encounter authentication problem. I encountered the authentication problem myself. Many others also encountered the same problem, for example, this and this. A few suggest that you should change your Yahoo password after you encounter the password authentication problem. I have tried it, and it worked for a while and the problem always reappeared. Finally, I realize that Thunderbird with Lightning has yet to support two-factor authentication (sometimes called two-step authentication) and have to treat Thunderbird with Lightning as an "old app" that does not support two-step authentication. 
Below is what Google says about the apps that do not support two-step authentication,

" When you sign up for 2-Step Verification, we normally send you verification codes. However, these codes do not work with some apps and devices, like Gmail on your iPhone or iPad, Thunderbird, and Outlook. Instead, you’ll need to authorize the app or device the first time you use it to sign in to your Google Account by generating and entering an App password. "

Below is what Yahoo says about the apps that do not support two-step authentication,

" Some 3rd party apps, such as iOS Mail, Android Mail, and Outlook, don't work with two-step verification, on-demand passwords (ODP) or Account Key enabled. To use these apps, you'll need to generate an app-specific password. This isn't a new password for your account. It's a one-time password to validate you're authorizing access to your account from a non-Yahoo app."
Therefore, the solution to put Yahoo Calendar on Thunderbird on Lightning is to follow the steps below,

  1. Following Yahoo's instruction, enable two-step authentication and generate an 16-character app password. Note the password. You will not be able to view it again.
  2. Following Mozilla's instruction, add Yahoo Calendar to Lightning using the 16-character app password.
I have not encounter any synchronization problem and authentication problem after I have done the above setup.

Yahoo! Calendar on Android Devices

The Google Play store has a few CalDAV clients. I use a free calendar app called SolCalendar that supports CalDAV services.

The only issue that I had was that it often encountered password authentication issue with Yahoo CalDAV service.

The solution is that you treat the SolCalendar as an old app that does not support two-step authentication and create an 16-character app password for it, following Yahoo's instruction.

  



Saturday, August 30, 2014

Problem Adding Google Account to Android Devices

I was trying to add the required Google Account to an Motorola Android phone and encountered a problem. The error message states,

Can’t establish a reliable data connection to the server.  This could be a temporary problem or your SIM card may not be provisioned  for data services. If it continues, call Customer Care.
Google searches produced numerous hits. I tried a few and they did not work for me.

After a little bit careful investigation, I noticed that the time displayed was far off. Although I checked the "Automatic Update Time" option, the device did not appear to update the time to a correct one. My understanding is that when the time is far off, any security protocol using SSL will not work as it requires the messages are time stamped recently, well, to prevent varous forms of the message replay attacks. Then, I used the following solution and it worked.

  1. Uncheck the "Automatic Update Time" option
  2. Manually set time to a correct one. I  used the clock on my computer as a reference. It does not have to be very precise. But, do note that the time zone on the Android device may not be the one your computer is in. If it is the case, you may use a time reference that is in the same time zone of the Android device (e.g., The Official NIST US Time); or simply set the time zone on the Android device to the time zone of your reference time. 
  3. Now add your Google account. It should work now.