Final_project - noxusfrosted/final_project_android GitHub Wiki
QuickTest
Features ของแอพฯ
- สามารถลงชื่อเข้าใช้ผ่านFacebook
- สามารถสร้างข้อสอบได้ (แบบปรนัย)
- สามารถแชร์ผลคะแนนของตน ไปยังFacebook
- สามารถทำข้อสอบของผู้อื่นได้
- สามารถแสดงคะแนนสอบของผู้อื่นได้ทั้งหมด
ScreenShot
API ที่ใช้
- Facebook API
- ใช้สำหรับเข้าสู่ระบบ และเรียกชื่อผู้ใช้เพื่อจัดเก็บคะแนน
- Facebook SDK for Android docs
- ตัวอย่างโค้ดที่ใช้
`
loginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(LoginResult loginResult) {
if (Profile.getCurrentProfile() == null) {
mProfileTracker = new ProfileTracker() {
@Override
protected void onCurrentProfileChanged(Profile oldProfile, Profile currentProfile) {
Intent intent = new Intent(LoginActivity.this,
IndexActivity.class);
startActivity(intent);
finish();
mProfileTracker.stopTracking();
}
};
} else {
Profile.getCurrentProfile();
Intent intent = new Intent(LoginActivity.this,
IndexActivity.class);
startActivity(intent);
finish();
}
}
@Override
public void onCancel() {
Toast.makeText(LoginActivity.this, "Try Again",
Toast.LENGTH_SHORT).show();
}
@Override
public void onError(FacebookException error) {
Toast.makeText(LoginActivity.this, "Error",
Toast.LENGTH_SHORT).show();
}
});`
- Firebase API
- ใช้ Firebase Realtime Database เป็นฐานข้อมูลในการจัดเก็บชุดข้อสอบ และจัดเก็บคะแนนสอบ
- Firebase Realtime Database docs
- ตัวอย่างโค้ด
`public void addQuizToFirebase(Quiz quiz) {
DatabaseReference mRootRef = FirebaseDatabase.getInstance().getReference();
DatabaseReference mMessagesRef = mRootRef.child("quiz");
mMessagesRef.push().setValue(quiz);
}`
APK
Video
Play Store
- comming soon