A website to create surveys and an Android APP to fill in the surveys.
com.journeyapps:zxing-android-embedded:3.5.0
- Move the
server/root
folder to your web server. - Open your web server and Android DevTools to open the
android-client
folder. - Open the home page, for a local web server for example:
http:localhost:8080/index.html
, you are supposed to see a page like this; - You can just open the
app-debug.apk
in android-client root folder, or build one with your Android DevTools. You should see the Welcome page.
- Create a survey on the web platform. After you finished one, they should show on the home page.
- Click the
Scan QRcode
button on the specific survey, here is the QR code for this survey. - Scan the QR code with your suvey app, the specific survey will automatically display in your app.
- After finish the questions, upload it to the android database and server database. A prompt will pop up to inform you.
- Exiting the APP requires you to unlock your system lock. Use your fingerprint or enter the passwork correctly, You can leave the app now.
- Please Never Name the Survey Title in Chinese
- Please make sure your phone and computer in the same LAN when you test on local server
Cherry_20176134 | Cynthia_20175980 | Geralt_20175990 |
---|---|---|
https://github.com/WindWaving/survey-teamwork | https://github.com/Cynthia879/survey-teamwork | https://github.com/LuSylvia/survey-teamwork |
1.How to create my own page dynamically?
- First, you have to write the XML of the page you want to create, assign an ID to the button control in the page, bind the control in the oncreate method, and then add the
onClick
attribute to the button, with the value of nextque. And a unique identifier is added to the page for representation. - Then, add new judgment statements i
onActivityResult
method, such asif(Jo.getString("type").equals("YourType")){ ShowYourType(); }
- Next, you need to judge the newly added page at thbeginning of the
nextque
method, such aspublic void nextque(View view) throwJSONException { Boolean flag=false; ...... if(style.equals("YourType")){ flag=saveYourTypeAnswer(); } ...... }
- Then judge whether the flag is true, and then adjudgment in the branch of
if (current + 1 < coun
, such asif(current+1<count){ ...... if(Jo.getString("type").equals("YourType")){ ShowYourType(); } ...... }
- Finally, implement showyourtype ansaveyourtypeanswer methods. There are similar methodin the source code. You can refer to them timplement your own methods.
2. How to upload the data?
- First, in ChooseActivity, all the answer will be saved in a String variable saveAnswer and questions will be saved in a array of string. The The total number of questions and the id of the questionnaire are also stored in the variables. They will be put into an intent pasted to the ReportActivity
CtoR.putExtra("answerJSON",saveAnswer);
CtoR.putExtra("count",count);
CtoR.putExtra("survey_id",Survey_id);
String[] quesArr=quesList.toArray(new String[quesList.size()]);
CtoR.putExtra("quesArr",quesArr);
- Second, ReportActivity will get the intent from ChooseActivity and get all the data to show them in a TextView. In this activity, the app will ask the user to get the permission of ACCESS_FINE_LOCATION, ACCESS_COARSE_LOCATION and READ_PHONE_STATE to get the information of user's location and imei.
- function of getting data and time when the user uploads the result
public String getTime(){...}
- function of getting location when the user uploads the result
public String getLocation() {...}
- function of getting the imei of user's phone
public String[] getIMEI() throws Exception {
All the data will be saved in the sqlite of the client and the database of the server. Once a data cannot be properly obtained it will be set to null. If the server receives the uploaded data, it will prompt the user to upload successfully. Otherwise, it will prompt the user to upload failed and ask the user to check the information of network Settings
Contract me if you have any problem in the following way:
- Email at [email protected]