Making Apps More Accessible

* The article source is from Udacity Nanodegree Program- Become an Android Developer * Accessibility refers to the design of products, devices, services, or environments for people who experience disabilities. Android provides accessibility features like TalkBack: It uses spoken feedback to describe the results of actions such as launching an app, and events such as notifications. Explore by Touch which … Continue reading Making Apps More Accessible

leetcode- Rotate Image

Leetcode: https://leetcode.com/problems/rotate-image/description/ Given input matrix = [1,2,3], [4,5,6], [7,8,9] rotate the input matrix in-place such that it becomes: [7,4,1], [8,5,2], [9,6,3] (x, y), the affected point is (y, n – x – 1), (n – x – 1, n – y – 1), (n – y – 1, x),  “n” is the size of the matrix. … Continue reading leetcode- Rotate Image

LeetCode – Plus One

Given a non-negative integer represented as a non-empty array of digits, plus one to the integer. You may assume the integer do not contain any leading zero, except the number 0 itself. The digits are stored such that the most significant digit is at the head of the list. For example: Q1. int[] nums = {1,2,3,4}; int[] … Continue reading LeetCode – Plus One

AsyncTask

Original artile : https://developer.android.com/reference/android/os/AsyncTask.html The three types used by an asynchronous task are the following: Params, the type of the parameters sent to the task upon execution. Progress, the type of the progress units published during the background computation. Result, the type of the result of the background computation. Not all types are always used … Continue reading AsyncTask

SUNSHINE APP : Background Task

GitHub: Synchronizing The Weather: S10.01-SynchronizingTheWeather SmarterSyncing: S10.02- SmarterSyncing Sunshine FirebaseJobDispatcher: S10.03-FirebaseJobDispatcher Sunshine Notifications: S10.04-Notifications * Reference: Udacity Nanodegree Program- Become an Android Developer * Fill out NotificationUtils We’ve started this for you, as there is some code that simply has nothing to do with creating notifications, and rather just accessing our data. We wanted you to get right into it, so … Continue reading SUNSHINE APP : Background Task

How to check if a string has all unique characters

GitHub:  solution 1.1 Check if the string is an ASCII string. There are many different solutions, I practiced with a HashSet. Time complexity: O (n). from Cracking the Code Interview , isUniqueChars2 is an insteresting solution. A good source to explain the solution: trying to understand: checker |= (1 << val) Reference: http://javahungry.blogspot.com/2014/11/string-has-all-unique-characters-java-example.html https://www.codeproject.com/Articles/760162/How-to-check-if-a-string-has-all-unique-characters

SUNSHINE APP : Details Activity

github: S0905-MoreDetails * Reference: Udacity Nanodegree Program- Become an Android Developer * To set up the Details Activity to use CursorLoaders to display more weather information in the Detail Layout. Create a projection array of Strings and indices to help query weather details for that date! Implement LoaderManager.LoaderCallbacks onCreateLoader: Checks if the loader requested is our detail loader, return … Continue reading SUNSHINE APP : Details Activity

SUNSHINE APP : Cursor Loader

* Reference: Udacity Nanodegree Program- Become an Android Developer * A CursorLoader is a subclass of AsyncTaskLoader that queries a ContentProvider, via a ContentResolver and specific URI, and returns a Cursor of desired data. This loader runs its query on a background thread so that it doesn’t block the UI. When a CursorLoader is active, it is … Continue reading SUNSHINE APP : Cursor Loader

Sunshine App : Content Provider – Query

github: S0901- ContentProviderFoundation * Reference: Udacity Nanodegree Program- Become an Android Developer * Add the Content Provider to the Manifest Setup the URIMatcher Initialize the Content Provider In this case, because the underlying data structure is a SQLite database, you need to make a connection to that database in the onCreate method Code Query It's important to set the notification … Continue reading Sunshine App : Content Provider – Query

CRUD method

github: T0904- Insert ,  T0905-QueryAllTasks , T0906- Delete , T0907-SwipeToDelete * The screenshots in the blog are from the Udacity Nanodegree Program: Become an Android Developer * Insert (Create) Query (Read) Query for all table data What Does the CustomCursorAdapter do? The CustomCursorAdapter will inflate views using the xml layout file task_layout, and create ViewHolders that will fill the main RecyclerView. Each ViewHolder includes data about a single task: it’s text description … Continue reading CRUD method