private fun createTimerNotification(application: Application, body: String): Notification {
return NotificationCompat.Builder(application, FOREGROUND_TIMER_NOTIFICATION_CHANNEL_ID)
.setContentTitle("Title")
.setContentText(body)
.setColor(AccentPurple.toArgb())
.setColorized(true)
.setStyle(NotificationCompat.DecoratedCustomViewStyle())
.setPriority(NotificationCompat.PRIORITY_MIN)
.setWhen(0)
.setSmallIcon(R.drawable.ic_launcher_foreground)
.setOngoing(true)
.build()
}
Category: Mobile
Add a calendar on Android Emulator
After much searching this is the only way I could figure out how to add a calendar when running in an Android Emulator. This is not a new problem, many users have complained about this on the internet see http://stackoverflow.com/questions/14971158/avd-emulator-has-no-option-to-sync-with-google-calendar
The solution I came to is based off of the idea from BizTalk Maven however this does not appear to work anymore (at least not for me) because according to Google.
“Starting January 30, 2013, users, other than paid Google Apps users, won’t be able to set up new devices using Google Sync”.
in other words unless you have a paid Google account, this method will not work with your Google account.
To get this to work I signed up for a free outlook.com account, and used that to add an account. Outlook.com supports Active Sync on it’s free accounts.
Steps I followed:
- Sign out for free account at outlook.com
- Select a Corporate Account
- Enter username such as [email protected]
- Select Manual Setup
- Select account type of “Exchange” (This will allow us to sync with active sync)
- Enter Server as s.outlook.com
- Security type as SSL/TLS
- Select next
If successful you will see a screen like this:
You are now done. Go test that calendar!
Visual Studio Tools for Apache Cordova Error, MDAVSCLI failed with code 8
I recently installed Visual Studio Tools for Apache Cordova CTP 3.1 in Visual Studio 2013 with Update 4 and when trying to build I kept getting the error:
Command failed with exit code 8 Visual Studio - mdavscli
The problem was that I has upgraded my version of Android SDK which was not compatible.
To troubleshoot this I turned on the diagnostic build here is how:
Go to Tools –> Options –> Projects and Solutions –> Build and Run, change MSBuild project build output verbosity to Diagnostic. Rebuild the project and post the text from output window
The output window showed the following error:
BUILD FAILED
C:\Programs\SDK\tools\ant\build.xml:597: The following error occurred while executing this line:
C:\Programs\SDK\tools\ant\build.xml:649: The following error occurred while executing this line:
C:\Programs\SDK\tools\ant\build.xml:694: Execute failed: java.io.IOException: Cannot run program
“C:\code\samh\platforms\android\CordovaLib\${aapt}”
(in directory “C:\code\samh\platforms\android\CordovaLib”): CreateProcess error=2,
after a little research I found out it looks like ant commands are broken in Android SDK 24.3, which cordova build is using.
I downgraded to previous release (24.2.0) and ant works fine now.
I downgraded to the following version of the sdk http://dl-ssl.google.com/android/repository/tools_r24.2-windows.zip
To downgrade:
- Find your Android SDK folder
- Locate the “tools” subfolder and rename it to “tools1” (just to keep a backup copy of the original tools folder)
- Likewise, rename platform-tools to platform-tools1
- Download from google repository the SDK Tool version you want to downgrade to (for instance: http://dl-ssl.google.com/android/repository/tools_r24.2-windows.zip) and unpack it.
- The ZIP file you downloaded contains a tools folder that has to be moved to your Android SDK folder.
- Likewise, download the platform tools (for instance: https://dl-ssl.google.com/android/repository/platform-tools_r19-windows.zip), and extract it in your SDK folder.