class SimpleSingleton {
private static SimpleSingleton sInstance;
private SimpleSingleton() {}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://stackoverflow.com/a/35446009 11 Ways to convert an InputStream to a String with perfomance tests | |
https://medium.com/@harrysinghio/android-studio-tips-and-tricks-part-1-5b42d043333d | |
https://medium.com/@harrysinghio/android-studio-tips-and-tricks-part-2-d6548f8c249f | |
https://play.kotlinlang.org/koans/overview | |
https://medium.com/@JasonWyatt/squeezing-performance-from-sqlite-insertions-971aff98eef2 | |
Courses: | |
http://web.stanford.edu/class/cs193a/videos.shtml | |
https://www.udacity.com/course/android-basics-networking--ud843 | |
https://www.udacity.com/course/new-android-fundamentals--ud851 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Builds the URL from query string. | |
* | |
* @param searchQuery The search string that will be queried for. | |
* @return The URL to use for the query. | |
*/ | |
public static URL buildUrl(String searchQuery) { | |
String baseUrl = "https://api.github.com/search/repositories"; | |
String paramQuery = "q"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
query = "sample query" | |
URL searchUrl = NetworkUtils.buildUrl(query); | |
new QueryTask().execute(searchUrl); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This method fires off an implicit Intent to open a webpage. | |
* | |
* @param url Url of webpage to open. Should start with http:// or https:// as that is the | |
* scheme of the URI expected with this Intent according to the Common Intents page | |
*/ | |
private void openWebPage(String url) { | |
Uri webpage = Uri.parse(url); | |
Intent intent = new Intent(Intent.ACTION_VIEW, webpage); | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
/* | |
* If savedInstanceState is not null, that means our Activity is not being started for the | |
* first time. Even if the savedInstanceState is not null, it is smart to check if the | |
* bundle contains the key we are looking for. | |
*/ | |
if (savedInstanceState != null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends AppCompatActivity implements | |
LoaderManager.LoaderCallbacks<String> { | |
private static final int LOADER_ID = 22; | |
private static final String SEARCH_QUERY_URL_EXTRA = "query"; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
/** | |
* Returns new list of N random elements from provided list. | |
* | |
* @param list list of elements to choose from | |
* @param n number of elements to choose | |
* @param <E> type of elements in a list | |
* @return new list of N random elements from provided list | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Java. Kotlin. | |
OOP. | |
Design patterns. | |
Solid. Clean architecture. | |
Rest, crud, http, soap. | |
Android version names. | |
Android system architecture. | |
Android components. Activity, service, broadcast receiver, content provider. | |
Material design. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources xmlns:tools="http://schemas.android.com/tools"> | |
<color name="red_50">#FFEBEE</color> | |
<color name="red_100">#FFCDD2</color> | |
<color name="red_200">#EF9A9A</color> | |
<color name="red_300">#E57373</color> | |
<color name="red_400">#EF5350</color> | |
<color name="red_500">#F44336</color> | |
<color name="red_600">#E53935</color> |
OlderNewer