Frank Böddeker
Master Thesis presentation
meinUnterricht.de
Android
Apps in general
Tools
Implementation
Api
Bug tracking
Conclusion
Education
Layout files
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout style="@style/LoginFormContainer"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
android:layout_marginBottom="40dp"
android:layout_marginTop="40dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:paddingTop="30dp">
...
</LinearLayout>
</LinearLayout>
R file
package de.meinunterricht.app;
public final class R {
...
public static final class layout {
public static final int activity_add_student=0x7f030018;
public static final int activity_add_test=0x7f030019;
public static final int activity_global=0x7f03001a;
...
}
...
}
//R.layout.activity_add_student
Balsamiq
Balsamiq
AndroidStudio
Genymotion
Gradle
Activity
Fragments
Activities/Fragments
//Activity onCreate()
if (savedInstanceState == null) {
getFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment())
.commit();
}
//Placeholder fragment onCreateView
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
rootView = inflater.inflate(R.layout.fragment_registration,
container,
false);
…
return rootView
}
Application
public class ApplicationHandler extends Application {
@Override
public void onCreate() {
super.onCreate();
}
public ApplicationHandler() {
user = new User();
}
}
Shared preferences
//Add something to Prefs
sharedPreferences = context.
getSharedPreferences(TOKEN, 0);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString("token", accessToken);
editor.commit();
//Read something from Prefs
sharedPreferences = context.
getSharedPreferences(TOKEN, 0);
sharedPreferences.getString("token", "empty");
Listviews
<ListView
android:id="@+id/student_pref_tests"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:clickable="false"
/>
Array adapter
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, android.R.id.text1, values);
Custom array adapter
One row
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:clickable="false"
android:focusable="false"
android:focusableInTouchMode="false"
android:id="@+id/one_row_linear_student_pref">
<!-- Term -->
<RelativeLayout android:id="@+id/pref_student_term_header"
...
</RelativeLayout>
<!-- ExamType -->
<RelativeLayout android:id="@+id/pref_student_exam_head"
...
</RelativeLayout>
<!-- GradeRow -->
<RelativeLayout style="@style/RowStyle"
...
</RelativeLayout>
</LinearLayout>
Custom Adapter
public StudentPrefAdapater(Context context,
SchoolClass schoolClass,
int gradingSystem) {
super(context,
R.layout.activity_student_pref_row,
((StudentPrefsActivity) context).getTests());
...
}
Custom Adapter getView()
//getView()
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.activity_student_pref_row, parent, false);
...
TextView examGrade = (TextView) convertView.findViewById(R.id.pref_student_examgrade)
Custom Adapter holder pattern
if (convertView == null) {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.row, parent, false);
holder = new StudentPrefHolder();
holder.setTermLayout((RelativeLayout) convertView.findViewById(R.id.head));
convertView.setTag(holder);
} else {
holder = (StudentPrefHolder) convertView.getTag();
}
...
static class StudentPrefHolder {
private RelativeLayout termLayout;
}
Number picker
Dialog communication
//onDialogDetach interface in Activity
@Override
public void onDialogDetach(NumberPickerFragment dialog) {
//the chosen value from the picker
int numberPickerValue = dialog.getValueFromPicker();
...
}
Navigation
switch (item.getItemId()) {
case R.id.context_menu_edit_pupil:
changeToPupilInformations();
return true;
case R.id.context_menu_delete_pupil:
deletePupil(classPosition, pupilPosition);
return true;
default:
return false;
}
Navigation
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- The main content view -->
<include layout="@layout/tabview_global"/>
<!-- The navigation drawer -->
<include layout="@layout/navigation_class_overview"/>
</android.support.v4.widget.DrawerLayout>
Navigation
studentOverviewFragment = (StudentOverviewFragment) tabFragment.
getChildFragmentManager().
findFragmentByTag("pupils");
if (studentOverviewFragment != null) {
studentOverviewFragment.updatePupilList(classPosition);
}
}
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.replace(R.id.global_content_frame, tabFragment, "tabTag");
ft.commit();
Api
repositories {
flatDir { dirs 'libs' }
}
dependencies {
compile’:lib:1.0@aar’
}
MuApi.schoolClass.put(JSONObject document, String specifier)
Api
Bug tracking
Bug tracking
Thank you