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) |
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 ActivityMainBinding binding; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
binding = DataBindingUtil.setContentView(this, R.layout.activity_main); | |
UserModel user = new UserModel(); |
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 Student extends RealmObject { | |
@PrimaryKey | |
private int studentId; | |
private String firstName; | |
private String lastName; | |
private int age; | |
private String gender; | |
private String city; |
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
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); | |
binding = CustomViewGroupBinding.inflate(inflater, this, true); |
OlderNewer