If you haven't already set your NPM author info, now you should:
npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"
npm adduser
# Built application files | |
/*/build/ | |
# Crashlytics configuations | |
com_crashlytics_export_strings.xml | |
# Local configuration file (sdk path, etc) | |
local.properties | |
# Gradle generated files |
import java.security.SecureRandom; | |
import javax.crypto.spec.PBEKeySpec; | |
import javax.crypto.SecretKeyFactory; | |
import java.math.BigInteger; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.spec.InvalidKeySpecException; | |
/* | |
* PBKDF2 salted password hashing. | |
* Author: havoc AT defuse.ca |
package main; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class Rectangle { | |
public static void main(String[] args) { |
package main; | |
import java.util.Map.Entry; | |
import java.util.Scanner; | |
import java.util.TreeMap; | |
public class Grid { | |
static int n = 0; | |
static int m = 0; |
AsyncTask helps us to do some heavy stuff on the thread other than UI. It allows us to do background operations and then publish to UI.
It must be subclassed and goes like this(for example):
AsyncTask<Parameters, Progress, Result>
And it has 4 steps: onPreExecute, doInBackground, onProgressUpdate, onPostExecute.
Adapter
class is a helper to RecyclerView
. It has three responsibilities: To return how many items should be in RecyclerView, inflate item views from XML and return new ViewHolder instance(object). and populate them with appropriate data(Basically, everything is in this order). So, it has (constructor and) three methods:
Constructor:
public MyAdapter(int numberOfItems, ListItemClickListener onClickListener)
where ListItemClickListener is an interface, which has one void
methoid defined, onListItemClick
.
onCreate -> Builds UI. Activity is created.
onStart -> Activity is visible.
onResume -> Becomes active foreground app.
In reverse:
So, let's imagine that we're making Preferences as Settings.
First, we make SettingsActivity
, of course, which is the plain activity we all know of. Its XML must actually be a fragment,
referring to SettingsFragment
(which we'll make; extends PreferenceFragmentCompat
) with android:name
.
Second, we make SettingsFragment with its XML preference xml(<PreferenceScreen and nested preferences in it) in res/xml directory.
And we bond the resource to a Fragment with addPreferencesFromResource
method.
Then, we must not forget to add preference theme(@style/PreferenceThemeOverlay) to styles.xml
, otherwise our app will crash.
If you configured the activity with singleTop launch mode, when you send an intent to android os to get a new instance of such activity, android os will first check the top activity in the back stack, if it is the requested activity type, it will return it, otherwise it will create a new instance of requested activity and return.
Yeah. Just sayin'.