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
image: openjdk:8-jdk | |
variables: | |
ANDROID_COMPILE_SDK: "25" | |
ANDROID_BUILD_TOOLS: "25.0.1" | |
ANDROID_SDK_TOOLS: "25.2.3" | |
before_script: | |
- apt-get --quiet update --yes | |
- apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1 |
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
try { | |
JsonObject header = new JsonObject(); | |
header.addProperty("alg", "HS256"); | |
header.addProperty("typ", "JWT"); | |
JsonObject playload = new JsonObject(); | |
playload.addProperty("iss", "pond"); | |
playload.addProperty("sub", "pond"); | |
String headerEncode = Base64.encodeToString(header.toString().getBytes(), Base64.URL_SAFE); |
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 | |
public void onViewAttachedToWindow(VH holder) { | |
super.onViewAttachedToWindow(holder); | |
int position; | |
if (holder.getItemViewType() == TYPE_ITEM) { | |
position = holder.getAdapterPosition(); | |
if (position > lastPosition) { | |
lastPosition = position; | |
holder.itemView.startAnimation(getAnim(holder.itemView.getContext())); | |
} |
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
is_maintenance = คือ flag บอกว่า server ได้ทำการ maintenance | |
maintenance_message = คือ เมื่อ is_maintenance เป็น true จะนำ ข้อความของ key นี้ มาแสดง บน App message คือ ข้อความประกาศ (announce) ให้ user | |
new_release_message คือ เมื่อมีการ update app จะเอาข้อความใน key นี้มาแสดง ครับ | |
force_update_message คือ เมื่อมีการ force update app จะเอาข้อความใน key นี้มาแสดง ครับ | |
latest_version คือ หมายเลข Build Number ของ app ครับ ถ้า ต่ำกว่าที่กำหนด อยู่ใน key นี้ จะ ขึ้น Dialog update แบบ กดข้าม ได้ ครับ | |
download_link คือ link store ของ app |
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 MyApplication extends Application { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
if (BuildConfig.DEBUG) { | |
Timber.plant(new Timber.DebugTree(){ | |
@Override | |
protected String createStackElementTag(StackTraceElement element) { |
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); | |
Timber.i("I'm %d years old", 22); | |
Timber.d("GPA : %.2f", 3.56); | |
Timber.wtf("%s %d %s %s %.2f", "I have ", 2, "cars", " and I have a money ", 1500.00); | |
} |
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 MyApplication extends Application { | |
@Override | |
public void onCreate() { | |
super.onCreate(); | |
if (BuildConfig.DEBUG) | |
Timber.plant(new Timber.DebugTree()); | |
} | |
} |
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 { | |
private final String TAG = MainActivity.class.getName(); | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
Realm.init(getApplicationContext()); |
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); | |
Realm.init(getApplicationContext()); | |
List<Student> students = new ArrayList<>(); |
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 StudentManager { | |
private final Realm realm; | |
private static StudentManager instance; | |
public StudentManager() { | |
realm = Realm.getDefaultInstance(); | |
} | |
public static StudentManager getInstance() { | |
if (instance == null) |
OlderNewer