├── Android Client ├── AndroidManifest.xml ├── java │ ├── ServerRequest.java │ └── com │ │ └── virtualclassroom │ │ └── main │ │ └── virtualclassroom │ │ ├── ForumActivity.java │ │ ├── LectureActivity.java │ │ ├── LoginActivity.java │ │ ├── LoginActivityFragment.java │ │ ├── MainActivity.java │ │ ├── ProfileActivity.java │ │ ├── Question.java │ │ ├── RegisterActivity.java │ │ ├── ResponseDetails.java │ │ └── VideoShow.java └── res │ ├── layout │ ├── activity_forum.xml │ ├── activity_lecture.xml │ ├── activity_login.xml │ ├── activity_main.xml │ ├── activity_profile.xml │ ├── activity_question.xml │ ├── activity_register.xml │ ├── activity_response_details.xml │ ├── activity_video_show.xml │ ├── attend_lecture_option.xml │ ├── chgpassword_frag.xml │ ├── content_forum.xml │ ├── content_lecture.xml │ ├── content_login.xml │ ├── content_main.xml │ ├── content_profile.xml │ ├── content_question.xml │ ├── content_register.xml │ ├── content_response_details.xml │ ├── content_video_show.xml │ ├── files_name.xml │ ├── files_on_server.xml │ ├── forum_answer.xml │ ├── fragment_login.xml │ ├── reset_pass_code.xml │ ├── reset_pass_init.xml │ ├── response_list_items.xml │ └── simple_list_view.xml │ ├── menu │ └── menu_login.xml │ ├── mipmap-hdpi │ ├── d.png │ └── ic_launcher.png │ ├── mipmap-mdpi │ ├── d.png │ └── ic_launcher.png │ ├── mipmap-xhdpi │ ├── d.png │ └── ic_launcher.png │ ├── mipmap-xxhdpi │ ├── d.png │ └── ic_launcher.png │ ├── mipmap-xxxhdpi │ ├── d.png │ └── ic_launcher.png │ ├── values-v21 │ └── styles.xml │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── Database └── New Text Document.txt ├── README.md ├── Screenshots ├── Screenshot_2016-05-14-09-23-18.png ├── Screenshot_2016-05-14-09-23-36.png ├── Screenshot_2016-05-14-09-23-41.png ├── Screenshot_2016-05-14-09-23-46.png ├── Screenshot_2016-05-14-09-24-09.png ├── Screenshot_2016-05-14-09-24-15.png ├── Screenshot_2016-05-14-09-24-20.png ├── Screenshot_2016-05-14-09-24-42.png ├── Screenshot_2016-05-14-09-24-48.png ├── Screenshot_2016-05-14-09-25-04.png ├── Screenshot_2016-05-14-09-25-33.png ├── Screenshot_2016-05-14-09-27-35.png └── Screenshot_2016-05-14-09-28-01.png ├── app-debug-unaligned.apk ├── app-debug.apk └── node JS Server ├── app.js ├── node_modules └── config │ ├── chgpass.js │ ├── login.js │ ├── loginFacutly.js │ ├── models.js │ └── register.js ├── package.json ├── routes └── routes.js └── webrtc-broadcasting ├── DetectRTC.js ├── README.md ├── RTCPeerConnection-v1.5.js ├── broadcast.js ├── firebase.js └── index.html /Android Client/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 19 | 23 | 26 | 29 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 43 | 47 | 51 | 55 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /Android Client/java/ServerRequest.java: -------------------------------------------------------------------------------- 1 | package com.virtualclassroom.main; 2 | 3 | 4 | import java.io.BufferedReader; 5 | import java.io.IOException; 6 | import java.io.InputStream; 7 | import java.io.InputStreamReader; 8 | import java.io.UnsupportedEncodingException; 9 | import java.util.List; 10 | import java.util.concurrent.ExecutionException; 11 | import org.apache.http.HttpEntity; 12 | import org.apache.http.HttpResponse; 13 | import org.apache.http.NameValuePair; 14 | import org.apache.http.client.ClientProtocolException; 15 | import org.apache.http.client.entity.UrlEncodedFormEntity; 16 | import org.apache.http.client.methods.HttpPost; 17 | import org.apache.http.impl.client.DefaultHttpClient; 18 | import org.json.JSONException; 19 | import org.json.JSONObject; 20 | 21 | import android.os.AsyncTask; 22 | import android.util.Log; 23 | 24 | public class ServerRequest { 25 | 26 | static InputStream is = null; 27 | static JSONObject jObj = null; 28 | static String json = ""; 29 | 30 | 31 | public ServerRequest() { 32 | 33 | } 34 | 35 | public JSONObject getJSONFromUrl(String url, List params) { 36 | 37 | 38 | try { 39 | 40 | DefaultHttpClient httpClient = new DefaultHttpClient(); 41 | HttpPost httpPost = new HttpPost(url); 42 | httpPost.setEntity(new UrlEncodedFormEntity(params)); 43 | 44 | HttpResponse httpResponse = httpClient.execute(httpPost); 45 | HttpEntity httpEntity = httpResponse.getEntity(); 46 | is = httpEntity.getContent(); 47 | 48 | } catch (UnsupportedEncodingException e) { 49 | e.printStackTrace(); 50 | } catch (ClientProtocolException e) { 51 | e.printStackTrace(); 52 | } catch (IOException e) { 53 | e.printStackTrace(); 54 | } 55 | 56 | try { 57 | BufferedReader reader = new BufferedReader(new InputStreamReader( 58 | is, "iso-8859-1"), 8); 59 | StringBuilder sb = new StringBuilder(); 60 | String line = null; 61 | while ((line = reader.readLine()) != null) { 62 | sb.append(line + "n"); 63 | } 64 | is.close(); 65 | json = sb.toString(); 66 | Log.e("JSON", json); 67 | } catch (Exception e) { 68 | Log.e("Buffer Error", "Error converting result " + e.toString()); 69 | } 70 | 71 | 72 | try { 73 | jObj = new JSONObject(json); 74 | } catch (JSONException e) { 75 | Log.e("JSON Parser", "Error parsing data " + e.toString()); 76 | } 77 | 78 | 79 | return jObj; 80 | 81 | } 82 | JSONObject jobj; 83 | public JSONObject getJSON(String url, List params) { 84 | 85 | Params param = new Params(url,params); 86 | Request myTask = new Request(); 87 | try{ 88 | jobj= myTask.execute(param).get(); 89 | }catch (InterruptedException e) { 90 | e.printStackTrace(); 91 | }catch (ExecutionException e){ 92 | e.printStackTrace(); 93 | } 94 | return jobj; 95 | } 96 | 97 | 98 | private static class Params { 99 | String url; 100 | List params; 101 | 102 | 103 | Params(String url, List params) { 104 | this.url = url; 105 | this.params = params; 106 | 107 | } 108 | } 109 | 110 | private class Request extends AsyncTask { 111 | 112 | @Override 113 | protected JSONObject doInBackground(Params... args) { 114 | 115 | ServerRequest request = new ServerRequest(); 116 | JSONObject json = request.getJSONFromUrl(args[0].url,args[0].params); 117 | 118 | return json; 119 | } 120 | 121 | @Override 122 | protected void onPostExecute(JSONObject json) { 123 | 124 | super.onPostExecute(json); 125 | 126 | } 127 | 128 | } 129 | 130 | 131 | } -------------------------------------------------------------------------------- /Android Client/java/com/virtualclassroom/main/virtualclassroom/ForumActivity.java: -------------------------------------------------------------------------------- 1 | package com.virtualclassroom.main.virtualclassroom; 2 | 3 | import android.app.ProgressDialog; 4 | import android.content.Intent; 5 | import android.content.SharedPreferences; 6 | import android.os.AsyncTask; 7 | import android.os.Bundle; 8 | import android.provider.Settings; 9 | import android.support.design.widget.FloatingActionButton; 10 | import android.support.design.widget.Snackbar; 11 | import android.support.v7.app.AppCompatActivity; 12 | import android.support.v7.widget.Toolbar; 13 | import android.util.Log; 14 | import android.view.LayoutInflater; 15 | import android.view.View; 16 | import android.view.ViewGroup; 17 | import android.widget.AbsListView; 18 | import android.widget.AdapterView; 19 | import android.widget.ArrayAdapter; 20 | import android.widget.Button; 21 | import android.widget.EditText; 22 | import android.widget.ListView; 23 | import android.widget.TextView; 24 | import android.widget.Toast; 25 | 26 | import com.virtualclassroom.main.ServerRequest; 27 | 28 | import org.apache.http.NameValuePair; 29 | import org.apache.http.message.BasicNameValuePair; 30 | import org.json.JSONArray; 31 | import org.json.JSONException; 32 | import org.json.JSONObject; 33 | 34 | import java.util.ArrayList; 35 | import java.util.HashMap; 36 | import java.util.Iterator; 37 | import java.util.List; 38 | import java.util.Objects; 39 | 40 | public class ForumActivity extends AppCompatActivity { 41 | EditText text; 42 | Button upload, refresh; 43 | String emailtxt,result="",ques=""; 44 | SharedPreferences pref; 45 | List params; 46 | HashMap data = new HashMap(); 47 | ListView forumlist; 48 | ArrayAdapter arrayAdapter; 49 | ProgressDialog progressDialog; 50 | boolean records=false; 51 | Forum[] forums; 52 | public static String totalAnswers="",totalUsers=""; 53 | 54 | 55 | @Override 56 | protected void onCreate(Bundle savedInstanceState) { 57 | 58 | super.onCreate(savedInstanceState); 59 | setContentView(R.layout.activity_forum); 60 | 61 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 62 | pref = getSharedPreferences("AppPref", MODE_PRIVATE); 63 | emailtxt = pref.getString("email", "Anonymous"); 64 | setSupportActionBar(toolbar); 65 | text = (EditText) findViewById(R.id.ques); 66 | upload = (Button) findViewById(R.id.upload); 67 | forumlist = (ListView) findViewById(R.id.list); 68 | forumlist.setOnItemClickListener(new AdapterView.OnItemClickListener() { 69 | @Override 70 | public void onItemClick(AdapterView parent, View view, int position, long id) { 71 | SharedPreferences.Editor edit = pref.edit(); 72 | Forum f = (Forum) parent.getItemAtPosition(parent.getCount() - 1 - position); 73 | edit.putString("emailFromForum", f.getQuesUser()); 74 | edit.putString("quesFromForum", f.getQues()); 75 | edit.putString("ansUserFromForum", f.getAnsUser()); 76 | edit.putString("ansFromForum", f.getAns()); 77 | edit.putString("email", emailtxt); 78 | edit.commit(); 79 | Intent i = new Intent(ForumActivity.this, Question.class); 80 | startActivity(i); 81 | 82 | } 83 | }); 84 | upload.setOnClickListener(new View.OnClickListener() { 85 | @Override 86 | public void onClick(View v) { 87 | if (text.getText().toString().trim().equals("")) 88 | Toast.makeText(getApplication(), "Plaese write something...", Toast.LENGTH_LONG).show(); 89 | else 90 | uploadQuestion(); 91 | } 92 | }); 93 | 94 | refresh = (Button) findViewById(R.id.refresh); 95 | refresh.setOnClickListener(new View.OnClickListener() { 96 | 97 | @Override 98 | public void onClick(View v) { 99 | try { 100 | 101 | getQuestionsList(true); 102 | 103 | } 104 | catch (Exception e) 105 | { 106 | Toast.makeText(getApplicationContext(),e.getMessage(),Toast.LENGTH_LONG).show(); 107 | } 108 | } 109 | 110 | 111 | }); 112 | 113 | 114 | } 115 | 116 | 117 | 118 | class Forum { 119 | String quesUser, ques, ansUser, ans; 120 | 121 | public String getQuesUser() { 122 | return quesUser; 123 | } 124 | 125 | public void setQuesUser(String quesUser) { 126 | this.quesUser = quesUser; 127 | } 128 | 129 | public String getQues() { 130 | return ques; 131 | } 132 | 133 | public void setQues(String ques) { 134 | this.ques = ques; 135 | } 136 | 137 | public String getAnsUser() { 138 | return ansUser; 139 | } 140 | 141 | public void setAnsUser(String ansUser) { 142 | this.ansUser = ansUser; 143 | } 144 | 145 | public String getAns() { 146 | return ans; 147 | } 148 | 149 | public void setAns(String ans) { 150 | this.ans = ans; 151 | } 152 | } 153 | 154 | class ForumAdapter extends ArrayAdapter { 155 | ForumAdapter() { 156 | super(getApplicationContext(), R.layout.simple_list_view, forums); 157 | } 158 | 159 | @Override 160 | public int getCount() { 161 | return forums.length; 162 | } 163 | 164 | 165 | @Override 166 | public View getView(int position, View convertView, ViewGroup parent) { 167 | if (convertView == null) { 168 | LayoutInflater layoutInflater = ForumActivity.this.getLayoutInflater(); 169 | convertView = layoutInflater.inflate(R.layout.simple_list_view, parent, false); 170 | } 171 | if (position < getCount()) { 172 | TextView firstLine = (TextView) convertView.findViewById(R.id.email); 173 | TextView secondLine = (TextView) convertView.findViewById(R.id.contents); 174 | firstLine.setText(String.valueOf(forums[getCount() - 1 - position].getQuesUser())); 175 | secondLine.setText(forums[getCount() - 1 - position].getQues()); 176 | } 177 | return convertView; 178 | } 179 | } 180 | 181 | 182 | public String[] getRefreshedList(String email ,String ques) 183 | { 184 | getQuestionsList(false); 185 | String[] response=new String[2]; 186 | for(int i=0;i(); 212 | ServerRequest sr = new ServerRequest(); 213 | // JSONObject json = sr.getJSON("http://192.168.56.1:8080/api/chgpass",params); 214 | JSONObject json = sr.getJSON("http://192.168.43.101:8080/forumList", params); 215 | if (json != null) { 216 | try { 217 | int i = 0; 218 | int len = json.length(); 219 | forums = new Forum[len]; 220 | Iterator iterator = json.keys(); 221 | while (iterator.hasNext()) { 222 | JSONObject jsonObject = json.getJSONObject(iterator.next()); 223 | Forum f = new Forum(); 224 | f.setQuesUser(jsonObject.getString("quesUser")); 225 | f.setQues(jsonObject.getString("ques")); 226 | f.setAnsUser(jsonObject.getString("ansUser")); 227 | f.setAns(jsonObject.getString("ans")); 228 | forums[i] = f; 229 | i++; 230 | } 231 | result=len+" Records Fetched!!"; 232 | records=true; 233 | 234 | } catch (JSONException e) { 235 | result=e.getMessage(); 236 | records=false; 237 | 238 | } 239 | 240 | } else { 241 | result = "No Records!!"; 242 | records=false; 243 | 244 | } 245 | 246 | if(value) { 247 | runOnUiThread(new Runnable() { 248 | @Override 249 | public void run() { 250 | Toast.makeText(getApplicationContext(), "Populating List...\n PLease Wait...", Toast.LENGTH_LONG); 251 | if (records) { 252 | setUpListView(); 253 | records = false; 254 | 255 | } 256 | progressDialog.dismiss(); 257 | Toast.makeText(getApplicationContext(), result, Toast.LENGTH_LONG); 258 | 259 | 260 | } 261 | }); 262 | } 263 | 264 | } 265 | 266 | 267 | }; 268 | t.setDaemon(true); 269 | t.start(); 270 | 271 | 272 | 273 | } 274 | 275 | public void setUpListView() 276 | { 277 | forumlist.setAdapter(new ForumAdapter()); 278 | 279 | } 280 | 281 | public void uploadQuestion() 282 | { 283 | progressDialog = new ProgressDialog(this); 284 | progressDialog.setMessage("Uploading..."); 285 | progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); 286 | progressDialog.setIndeterminate(true); 287 | progressDialog.setCanceledOnTouchOutside(false); 288 | 289 | progressDialog.show(); 290 | 291 | final Thread t = new Thread() { 292 | 293 | public void run() { 294 | params = new ArrayList(); 295 | pref = getSharedPreferences("AppPref", MODE_PRIVATE); 296 | emailtxt = pref.getString("email", ""); 297 | params.add(new BasicNameValuePair("quesUser", emailtxt)); 298 | params.add(new BasicNameValuePair("ques", text.getText().toString().trim())); 299 | ServerRequest sr = new ServerRequest(); 300 | // JSONObject json = sr.getJSON("http://192.168.56.1:8080/api/chgpass",params); 301 | JSONObject json = sr.getJSON("http://192.168.43.101:8080/registerForum", params); 302 | if (json != null) { 303 | try { 304 | String jsonstr = json.getString("response"); 305 | result=jsonstr; 306 | 307 | } catch (JSONException e) { 308 | result=e.getMessage(); 309 | } 310 | } 311 | 312 | runOnUiThread(new Runnable() { 313 | @Override 314 | public void run() { 315 | progressDialog.dismiss(); 316 | text.setText(""); 317 | Toast.makeText(getApplicationContext(),result,Toast.LENGTH_LONG).show(); 318 | getQuestionsList(true); 319 | } 320 | }); 321 | 322 | } 323 | }; 324 | t.setDaemon(true); 325 | t.start(); 326 | 327 | 328 | 329 | } 330 | 331 | 332 | 333 | 334 | } -------------------------------------------------------------------------------- /Android Client/java/com/virtualclassroom/main/virtualclassroom/LectureActivity.java: -------------------------------------------------------------------------------- 1 | package com.virtualclassroom.main.virtualclassroom; 2 | 3 | import android.os.Bundle; 4 | import android.support.design.widget.FloatingActionButton; 5 | import android.support.design.widget.Snackbar; 6 | import android.support.v7.app.AppCompatActivity; 7 | import android.support.v7.widget.Toolbar; 8 | import android.view.View; 9 | import android.webkit.WebChromeClient; 10 | import android.webkit.WebSettings; 11 | import android.webkit.WebView; 12 | import android.webkit.WebViewClient; 13 | 14 | public class LectureActivity extends AppCompatActivity { 15 | WebView webView; 16 | String url="192.168.43.101:8081"; 17 | @Override 18 | protected void onCreate(Bundle savedInstanceState) { 19 | super.onCreate(savedInstanceState); 20 | setContentView(R.layout.activity_lecture); 21 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 22 | setSupportActionBar(toolbar); 23 | webView=(WebView)findViewById(R.id.lecture); 24 | 25 | webView.setWebChromeClient(new WebChromeClient()); 26 | webView.getSettings().setJavaScriptEnabled(true); 27 | webView.getSettings().setLoadWithOverviewMode(true); 28 | webView.getSettings().setUseWideViewPort(true); 29 | webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); 30 | webView.setScrollbarFadingEnabled(false); 31 | webView.getSettings().setBuiltInZoomControls(true); 32 | webView.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN); 33 | webView.getSettings().setAllowUniversalAccessFromFileURLs(true); 34 | webView.setWebViewClient(new MyLecture()); 35 | webView.loadUrl(url); 36 | } 37 | 38 | class MyLecture extends WebViewClient{ 39 | @Override 40 | public boolean shouldOverrideUrlLoading(WebView view, String url) { 41 | view.loadUrl(url); 42 | return true; 43 | } 44 | } 45 | 46 | @Override 47 | public void onBackPressed() { 48 | super.onBackPressed(); 49 | webView.clearSslPreferences(); 50 | webView.clearCache(true); 51 | finish(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Android Client/java/com/virtualclassroom/main/virtualclassroom/LoginActivity.java: -------------------------------------------------------------------------------- 1 | package com.virtualclassroom.main.virtualclassroom; 2 | 3 | import android.app.ProgressDialog; 4 | import android.inputmethodservice.KeyboardView; 5 | import android.os.AsyncTask; 6 | import android.os.Bundle; 7 | import android.support.design.widget.FloatingActionButton; 8 | import android.support.design.widget.Snackbar; 9 | import android.support.v7.app.AppCompatActivity; 10 | import android.support.v7.widget.Toolbar; 11 | import android.view.View; 12 | import android.view.Menu; 13 | import android.view.MenuItem; 14 | 15 | import android.app.Activity; 16 | import android.app.Dialog; 17 | import android.content.Intent; 18 | import android.content.SharedPreferences; 19 | import android.os.Bundle; 20 | import android.util.Log; 21 | import android.view.View; 22 | import android.widget.Button; 23 | import android.widget.EditText; 24 | import android.widget.Toast; 25 | 26 | import org.apache.http.NameValuePair; 27 | import org.apache.http.message.BasicNameValuePair; 28 | import org.json.JSONException; 29 | import org.json.JSONObject; 30 | 31 | import java.util.ArrayList; 32 | import java.util.List; 33 | 34 | import com.virtualclassroom.main.ServerRequest; 35 | 36 | 37 | public class LoginActivity extends AppCompatActivity { 38 | EditText email,password,res_email,code,newpass; 39 | Button login,cont,cont_code,cancel,cancel1,register,forpass; 40 | String emailtxt,passwordtxt,email_res_txt,code_txt,npass_txt; 41 | List params; 42 | SharedPreferences pref; 43 | Dialog reset; 44 | ServerRequest sr; 45 | String k,jsonstr=null; 46 | ProgressDialog progressDialog; 47 | 48 | @Override 49 | protected void onCreate(Bundle savedInstanceState) { 50 | super.onCreate(savedInstanceState); 51 | setContentView(R.layout.activity_login); 52 | pref = getSharedPreferences("AppPref", MODE_PRIVATE); 53 | sr = new ServerRequest(); 54 | Intent i=getIntent(); 55 | Bundle b=i.getExtras(); 56 | if(b!=null) { 57 | k = (String) b.get("name"); 58 | this.setTitle(k+" Login "); 59 | } 60 | 61 | email = (EditText)findViewById(R.id.email); 62 | password = (EditText)findViewById(R.id.password); 63 | login = (Button)findViewById(R.id.loginbtn); 64 | register = (Button)findViewById(R.id.register); 65 | forpass = (Button)findViewById(R.id.forgotpass); 66 | 67 | register.setOnClickListener(new View.OnClickListener() { 68 | @Override 69 | public void onClick(View view) { 70 | Intent regactivity = new Intent(LoginActivity.this,RegisterActivity.class); 71 | regactivity.putExtra("name",LoginActivity.this.k); 72 | startActivity(regactivity); 73 | 74 | } 75 | }); 76 | 77 | 78 | login.setOnClickListener(new View.OnClickListener() { 79 | 80 | 81 | @Override 82 | public void onClick(View view) { 83 | try { 84 | 85 | Login(); 86 | 87 | }catch (Exception e) 88 | { 89 | Toast.makeText(getApplication(),e.getMessage(),Toast.LENGTH_LONG).show(); 90 | } 91 | } 92 | }); 93 | 94 | forpass.setOnClickListener(new View.OnClickListener(){ 95 | @Override 96 | public void onClick(View view) { 97 | reset = new Dialog(LoginActivity.this); 98 | reset.setTitle("Reset Password"); 99 | reset.setContentView(R.layout.reset_pass_init); 100 | cont = (Button)reset.findViewById(R.id.resbtn); 101 | cancel = (Button)reset.findViewById(R.id.cancelbtn); 102 | cancel.setOnClickListener(new View.OnClickListener() { 103 | @Override 104 | public void onClick(View view) { 105 | reset.dismiss(); 106 | } 107 | }); 108 | res_email = (EditText)reset.findViewById(R.id.email); 109 | 110 | cont.setOnClickListener(new View.OnClickListener() { 111 | @Override 112 | public void onClick(View view) { 113 | email_res_txt = res_email.getText().toString(); 114 | 115 | params = new ArrayList(); 116 | params.add(new BasicNameValuePair("email", email_res_txt)); 117 | 118 | // JSONObject json = sr.getJSON("http://192.168.56.1:8080/api/resetpass", params); 119 | JSONObject json = sr.getJSON("http://192.168.43.101:8080/api/resetpass", params); 120 | 121 | if (json != null) { 122 | try { 123 | String jsonstr = json.getString("response"); 124 | if(json.getBoolean("res")){ 125 | Log.e("JSON", jsonstr); 126 | Toast.makeText(getApplication(), jsonstr, Toast.LENGTH_LONG).show(); 127 | reset.setContentView(R.layout.reset_pass_code); 128 | cont_code = (Button)reset.findViewById(R.id.conbtn); 129 | code = (EditText)reset.findViewById(R.id.code); 130 | newpass = (EditText)reset.findViewById(R.id.npass); 131 | cancel1 = (Button)reset.findViewById(R.id.cancel); 132 | cancel1.setOnClickListener(new View.OnClickListener() { 133 | @Override 134 | public void onClick(View view) { 135 | reset.dismiss(); 136 | } 137 | }); 138 | cont_code.setOnClickListener(new View.OnClickListener() { 139 | @Override 140 | public void onClick(View view) { 141 | code_txt = code.getText().toString(); 142 | npass_txt = newpass.getText().toString(); 143 | Log.e("Code",code_txt); 144 | Log.e("New pass",npass_txt); 145 | params = new ArrayList(); 146 | params.add(new BasicNameValuePair("email", email_res_txt)); 147 | params.add(new BasicNameValuePair("code", code_txt)); 148 | params.add(new BasicNameValuePair("newpass", npass_txt)); 149 | 150 | JSONObject json = sr.getJSON("http://192.168.43.101:8080/api/resetpass/chg", params); 151 | // JSONObject json = sr.getJSON("http://192.168.56.1:8080/api/resetpass/chg", params); 152 | 153 | if (json != null) { 154 | try { 155 | 156 | String jsonstr = json.getString("response"); 157 | if(json.getBoolean("res")){ 158 | reset.dismiss(); 159 | Toast.makeText(getApplication(),jsonstr,Toast.LENGTH_LONG).show(); 160 | 161 | }else{ 162 | Toast.makeText(getApplication(),jsonstr,Toast.LENGTH_LONG).show(); 163 | 164 | } 165 | } catch (JSONException e) { 166 | Toast.makeText(getApplication(), "Check Your Internet Connection - "+e.getMessage(), Toast.LENGTH_SHORT).show(); 167 | 168 | } 169 | } 170 | 171 | } 172 | }); 173 | }else{ 174 | 175 | Toast.makeText(getApplication(),jsonstr,Toast.LENGTH_LONG).show(); 176 | 177 | } 178 | } catch (JSONException e) { 179 | Toast.makeText(getApplication(), "Check Your Internet Connection - "+e.getMessage(), Toast.LENGTH_SHORT).show(); 180 | 181 | } 182 | } 183 | 184 | } 185 | }); 186 | 187 | 188 | reset.show(); 189 | } 190 | }); 191 | } 192 | 193 | 194 | 195 | 196 | 197 | public void Login() { 198 | emailtxt = email.getText().toString().trim(); 199 | passwordtxt = password.getText().toString().trim(); 200 | progressDialog=new ProgressDialog(LoginActivity.this); 201 | progressDialog.setMessage("Please Wait..."); 202 | progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); 203 | progressDialog.setIndeterminate(true); 204 | progressDialog.setCanceledOnTouchOutside(false); 205 | progressDialog.show(); 206 | 207 | final Thread t = new Thread() { 208 | public void run() { 209 | JSONObject json; 210 | params = new ArrayList(); 211 | params.add(new BasicNameValuePair("email", emailtxt)); 212 | params.add(new BasicNameValuePair("password", passwordtxt)); 213 | ServerRequest sr = new ServerRequest(); 214 | if(LoginActivity.this.k.toUpperCase().equals("FACULTY")) 215 | json = sr.getJSON("http://192.168.43.101:8080/loginFaculty",params); 216 | else 217 | json = sr.getJSON("http://192.168.43.101:8080/login", params); 218 | if (json != null) { 219 | try { 220 | jsonstr = json.getString("response"); 221 | } catch (JSONException e) { 222 | jsonstr=e.getMessage(); 223 | } 224 | } 225 | try { 226 | if (json.getBoolean("res")) { 227 | 228 | String token = json.getString("token"); 229 | String grav = json.getString("grav"); 230 | String name = json.getString("name"); 231 | String branch = json.getString("branch"); 232 | String email = json.getString("email"); 233 | SharedPreferences.Editor edit = pref.edit(); 234 | edit.putString("token", token); 235 | edit.putString("grav", grav); 236 | edit.putString("email", email); 237 | edit.putString("name", name); 238 | edit.putString("branch", branch); 239 | edit.putString("owner", k); 240 | edit.commit(); 241 | progressDialog.dismiss(); 242 | Intent profactivity = new Intent(LoginActivity.this, ProfileActivity.class); 243 | startActivity(profactivity); 244 | finish(); 245 | } 246 | 247 | 248 | } catch (Exception e) { 249 | 250 | jsonstr+=" "+e.getMessage(); 251 | } 252 | 253 | 254 | runOnUiThread(new Runnable() { 255 | @Override 256 | public void run() { 257 | progressDialog.dismiss(); 258 | Toast.makeText(getApplication(), jsonstr, Toast.LENGTH_SHORT).show(); 259 | email.setText(""); 260 | password.setText(""); 261 | } 262 | }); 263 | 264 | 265 | } 266 | }; 267 | t.setDaemon(true); 268 | t.start(); 269 | 270 | 271 | 272 | } 273 | 274 | 275 | } 276 | -------------------------------------------------------------------------------- /Android Client/java/com/virtualclassroom/main/virtualclassroom/LoginActivityFragment.java: -------------------------------------------------------------------------------- 1 | package com.virtualclassroom.main.virtualclassroom; 2 | 3 | import android.support.v4.app.Fragment; 4 | import android.os.Bundle; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | /** 10 | * A placeholder fragment containing a simple view. 11 | */ 12 | public class LoginActivityFragment extends Fragment { 13 | 14 | public LoginActivityFragment() { 15 | } 16 | 17 | @Override 18 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 19 | Bundle savedInstanceState) { 20 | return inflater.inflate(R.layout.fragment_login, container, false); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Android Client/java/com/virtualclassroom/main/virtualclassroom/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.virtualclassroom.main.virtualclassroom; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.design.widget.FloatingActionButton; 6 | import android.support.design.widget.Snackbar; 7 | import android.support.v7.app.AppCompatActivity; 8 | import android.support.v7.widget.Toolbar; 9 | import android.view.View; 10 | import android.widget.Button; 11 | 12 | public class MainActivity extends AppCompatActivity { 13 | 14 | @Override 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.activity_main); 18 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 19 | setSupportActionBar(toolbar); 20 | Button b1=(Button)findViewById(R.id.button); 21 | Button b2=(Button)findViewById(R.id.button2); 22 | b1.setOnClickListener(new View.OnClickListener() { 23 | @Override 24 | public void onClick(View v) { 25 | 26 | Intent i=new Intent(MainActivity.this,LoginActivity.class); 27 | i.putExtra("name","student"); 28 | startActivity(i); 29 | finish(); 30 | } 31 | }); 32 | b2.setOnClickListener(new View.OnClickListener() { 33 | @Override 34 | public void onClick(View v) { 35 | 36 | Intent i=new Intent(MainActivity.this,LoginActivity.class); 37 | i.putExtra("name","faculty"); 38 | startActivity(i); 39 | finish(); 40 | } 41 | }); 42 | 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /Android Client/java/com/virtualclassroom/main/virtualclassroom/ProfileActivity.java: -------------------------------------------------------------------------------- 1 | package com.virtualclassroom.main.virtualclassroom; 2 | 3 | import android.app.ProgressDialog; 4 | import android.content.Context; 5 | import android.net.Uri; 6 | import android.os.AsyncTask; 7 | import android.os.Bundle; 8 | 9 | import android.support.v7.app.AppCompatActivity; 10 | import android.support.v7.widget.Toolbar; 11 | import android.util.Log; 12 | import android.view.LayoutInflater; 13 | import android.view.View; 14 | import java.io.FileOutputStream; 15 | 16 | import com.koushikdutta.ion.*; 17 | 18 | import java.io.BufferedInputStream; 19 | import java.io.FileOutputStream; 20 | import java.io.InputStream; 21 | import java.io.OutputStream; 22 | import java.net.URL; 23 | import java.net.URLConnection; 24 | import java.util.Iterator; 25 | import java.util.concurrent.Future; 26 | import com.koushikdutta.async.future.FutureCallback; 27 | 28 | import android.app.Activity; 29 | import android.app.Dialog; 30 | import android.content.Intent; 31 | import android.content.SharedPreferences; 32 | import android.os.Bundle; 33 | import android.view.View; 34 | import android.view.ViewGroup; 35 | import android.webkit.WebView; 36 | import android.widget.AdapterView; 37 | import android.widget.ArrayAdapter; 38 | import android.widget.Button; 39 | import android.widget.EditText; 40 | import android.widget.ListView; 41 | import android.widget.TextView; 42 | import android.widget.Toast; 43 | 44 | import com.virtualclassroom.main.ServerRequest; 45 | 46 | import org.apache.http.NameValuePair; 47 | import org.apache.http.message.BasicNameValuePair; 48 | import org.json.JSONArray; 49 | import org.json.JSONException; 50 | import org.json.JSONObject; 51 | import org.jsoup.Jsoup; 52 | import org.jsoup.nodes.Element; 53 | import org.jsoup.nodes.Document; 54 | import org.jsoup.select.Elements; 55 | 56 | 57 | import java.io.File; 58 | import java.util.ArrayList; 59 | import java.util.List; 60 | 61 | public class ProfileActivity extends AppCompatActivity { 62 | 63 | 64 | SharedPreferences pref; 65 | 66 | String token, grav, oldpasstxt, newpasstxt, emailtxt, nametxt, branchtxt, passwordtxt,owner,file_to_download=""; 67 | WebView web; 68 | Button chgpass, chgpassfr, cancel, logout, forum, fileupload,lecture,livelecture,recordlecture; 69 | Dialog dlg,filesDialog,lectuedlg,lecturesDialog; 70 | EditText oldpass, newpass; 71 | TextView nameTextView, branchTV, emailTV, filename; 72 | List params; 73 | List filesOnServer; 74 | Object files[]; 75 | ListView filesList; 76 | ProgressDialog progressDialog; 77 | @Override 78 | protected void onCreate(Bundle savedInstanceState) { 79 | super.onCreate(savedInstanceState); 80 | setContentView(R.layout.activity_profile); 81 | lecture=(Button)findViewById(R.id.lecture); 82 | lecture.setOnClickListener(new View.OnClickListener() { 83 | @Override 84 | public void onClick(View v) { 85 | Intent i = new Intent(ProfileActivity.this, LectureActivity.class); 86 | startActivity(i); 87 | 88 | } 89 | }); 90 | // web = (WebView)findViewById(R.id.webView); 91 | lecture.setOnClickListener(new View.OnClickListener() { 92 | @Override 93 | public void onClick(View v) { 94 | 95 | lectuedlg=new Dialog(ProfileActivity.this); 96 | if(owner.trim().equals("faculty")) 97 | lectuedlg.setTitle("Options..."); 98 | else 99 | lectuedlg.setTitle("You can Watch ..."); 100 | lectuedlg.setContentView(R.layout.attend_lecture_option); 101 | livelecture=(Button)lectuedlg.findViewById(R.id.option1); 102 | recordlecture=(Button)lectuedlg.findViewById(R.id.option2); 103 | if(owner.trim().equals("faculty")) 104 | livelecture.setText("Take Lecture"); 105 | lectuedlg.show(); 106 | recordlecture.setOnClickListener(new View.OnClickListener() { 107 | @Override 108 | public void onClick(View v) { 109 | params = new ArrayList(); 110 | 111 | ServerRequest sr = new ServerRequest(); 112 | JSONObject json = sr.getJSON("http://192.168.43.101:8080/videoList", params); 113 | if (json != null) { 114 | try { 115 | int len = json.length(); 116 | filesOnServer=new ArrayList(len); 117 | if(len==0) 118 | Toast.makeText(getApplication(), "No Vedios Available!", Toast.LENGTH_SHORT).show(); 119 | else { 120 | JSONArray jsonArray=json.getJSONArray("Files"); 121 | for(int i=0;i parent, View view, int position, long id) { 142 | 143 | String filename = (String) parent.getItemAtPosition(position); 144 | SharedPreferences.Editor edit = pref.edit(); 145 | edit.putString("file", "http://192.168.43.101:8080/video?name="+filename); 146 | edit.commit(); 147 | Intent i = new Intent(ProfileActivity.this, VideoShow.class); 148 | startActivity(i); 149 | 150 | 151 | } 152 | 153 | }); 154 | 155 | } 156 | }); 157 | 158 | livelecture.setOnClickListener(new View.OnClickListener() { 159 | @Override 160 | public void onClick(View v) { 161 | if (owner.trim().equals("faculty")) { 162 | Intent i = new Intent(Intent.ACTION_VIEW); 163 | i.setData(Uri.parse("https://www.webrtc-experiment.com/webrtc-broadcasting/")); 164 | startActivity(i); 165 | } 166 | else 167 | { 168 | SharedPreferences.Editor edit = pref.edit(); 169 | edit.putString("file", "https://www.webrtc-experiment.com/webrtc-broadcasting/"); 170 | edit.commit(); 171 | Intent i = new Intent(ProfileActivity.this, VideoShow.class); 172 | startActivity(i); 173 | //new JP().execute("https://www.webrtc-experiment.com/webrtc-broadcasting/"); 174 | } 175 | 176 | } 177 | }); 178 | 179 | } 180 | }); 181 | chgpass = (Button) findViewById(R.id.chgbtn); 182 | logout = (Button) findViewById(R.id.logout); 183 | nameTextView = (TextView) findViewById(R.id.name); 184 | branchTV = (TextView) findViewById(R.id.branch); 185 | emailTV = (TextView) findViewById(R.id.email); 186 | filename = (TextView) findViewById(R.id.filename); 187 | forum = (Button) findViewById(R.id.forum); 188 | 189 | 190 | forum.setOnClickListener(new View.OnClickListener() { 191 | @Override 192 | public void onClick(View v) { 193 | SharedPreferences.Editor edit = pref.edit(); 194 | //Storing Data using SharedPreferences 195 | edit.putString("email", ProfileActivity.this.emailtxt); 196 | edit.commit(); 197 | Intent loginactivity = new Intent(ProfileActivity.this, ForumActivity.class); 198 | startActivity(loginactivity); 199 | 200 | } 201 | }); 202 | 203 | fileupload = (Button) findViewById(R.id.fileuplaod); 204 | fileupload.setOnClickListener(new View.OnClickListener() { 205 | @Override 206 | public void onClick(View v) { 207 | if (owner.trim().equals("faculty")) { 208 | ProfileActivity.this.showFiles(); 209 | } else { 210 | params = new ArrayList(); 211 | 212 | ServerRequest sr = new ServerRequest(); 213 | JSONObject json = sr.getJSON("http://192.168.43.101:8080/filesList", params); 214 | if (json != null) { 215 | try { 216 | int len = json.length(); 217 | filesOnServer=new ArrayList(len); 218 | if(len==0) 219 | Toast.makeText(getApplication(), "No files Available For Download!!", Toast.LENGTH_SHORT).show(); 220 | else { 221 | JSONArray jsonArray=json.getJSONArray("Files"); 222 | for(int i=0;i parent, View view, int position, long id) { 243 | 244 | String filename=(String)parent.getItemAtPosition(position); 245 | 246 | String url = "http://192.168.43.101:8080/download?name="+filename.trim(); 247 | file_to_download=filename; 248 | new DownloadFileAsync().execute(url); 249 | 250 | 251 | 252 | 253 | } 254 | 255 | }); 256 | } 257 | 258 | } 259 | }); 260 | 261 | logout.setOnClickListener(new View.OnClickListener() { 262 | @Override 263 | public void onClick(View view) { 264 | SharedPreferences.Editor edit = pref.edit(); 265 | //Storing Data using SharedPreferences 266 | edit.putString("token", ""); 267 | edit.commit(); 268 | Intent loginactivity = new Intent(ProfileActivity.this, LoginActivity.class); 269 | startActivity(loginactivity); 270 | finish(); 271 | 272 | } 273 | }); 274 | 275 | pref = getSharedPreferences("AppPref", MODE_PRIVATE); 276 | token = pref.getString("token", ""); 277 | grav = pref.getString("grav", ""); 278 | emailtxt = pref.getString("email", "no email"); 279 | nametxt = pref.getString("name", "No name"); 280 | branchtxt = pref.getString("branch", ""); 281 | owner=pref.getString("owner",""); 282 | emailTV.setText(emailtxt); 283 | branchTV.setText(branchtxt); 284 | nameTextView.setText(nametxt); 285 | if(owner.trim().equals("student")) 286 | fileupload.setText("File Download"); 287 | else 288 | fileupload.setText("File Upload"); 289 | chgpass.setOnClickListener(new View.OnClickListener() { 290 | @Override 291 | public void onClick(View view) { 292 | dlg = new Dialog(ProfileActivity.this); 293 | dlg.setContentView(R.layout.chgpassword_frag); 294 | dlg.setTitle("Change Password"); 295 | chgpassfr = (Button) dlg.findViewById(R.id.chgbtn); 296 | 297 | chgpassfr.setOnClickListener(new View.OnClickListener() { 298 | @Override 299 | public void onClick(View view) { 300 | oldpass = (EditText) dlg.findViewById(R.id.oldpass); 301 | newpass = (EditText) dlg.findViewById(R.id.newpass); 302 | oldpasstxt = oldpass.getText().toString(); 303 | newpasstxt = newpass.getText().toString(); 304 | params = new ArrayList(); 305 | params.add(new BasicNameValuePair("oldpass", oldpasstxt)); 306 | params.add(new BasicNameValuePair("newpass", newpasstxt)); 307 | params.add(new BasicNameValuePair("id", token)); 308 | ServerRequest sr = new ServerRequest(); 309 | // JSONObject json = sr.getJSON("http://192.168.56.1:8080/api/chgpass",params); 310 | JSONObject json = sr.getJSON("http://192.168.43.101:8080/api/chgpass", params); 311 | if (json != null) { 312 | try { 313 | String jsonstr = json.getString("response"); 314 | if (json.getBoolean("res")) { 315 | 316 | dlg.dismiss(); 317 | Toast.makeText(getApplication(), jsonstr, Toast.LENGTH_SHORT).show(); 318 | } else { 319 | Toast.makeText(getApplication(), jsonstr, Toast.LENGTH_SHORT).show(); 320 | } 321 | } catch (JSONException e) { 322 | Toast.makeText(getApplication(), "Check Your Internet Connection - "+e.getMessage(), Toast.LENGTH_SHORT).show(); 323 | 324 | } 325 | } 326 | 327 | } 328 | }); 329 | cancel = (Button) dlg.findViewById(R.id.cancelbtn); 330 | cancel.setOnClickListener(new View.OnClickListener() { 331 | @Override 332 | public void onClick(View view) { 333 | dlg.dismiss(); 334 | } 335 | }); 336 | dlg.show(); 337 | } 338 | }); 339 | 340 | 341 | } 342 | 343 | public void showFiles() { 344 | Intent intent = new Intent(); 345 | intent.setType("*/*"); 346 | intent.setAction(Intent.ACTION_GET_CONTENT); 347 | startActivityForResult(Intent.createChooser(intent, "Choose File"), 1); 348 | } 349 | 350 | @Override 351 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { 352 | if (resultCode == RESULT_CANCELED) { 353 | // action cancelled 354 | } 355 | if (resultCode == RESULT_OK) { 356 | 357 | new UploadTask().execute(data); 358 | } 359 | 360 | 361 | } 362 | 363 | 364 | 365 | class UploadTask extends AsyncTask 366 | { 367 | String msg=""; 368 | @Override 369 | protected String doInBackground(Intent... params) { 370 | 371 | Intent data=params[0]; 372 | try { 373 | 374 | Uri selectedimg = data.getData(); 375 | 376 | Ion.getDefault(ProfileActivity.this).setLogging("ion-logging", Log.DEBUG); 377 | File f = new File(selectedimg.getEncodedPath()); 378 | Future uploading = Ion.with(ProfileActivity.this) 379 | .load("http://192.168.43.101:8080/upload") 380 | .setMultipartFile("image", f) 381 | .asString() 382 | .withResponse() 383 | .setCallback(new FutureCallback>() { 384 | @Override 385 | public void onCompleted(Exception e, Response result) { 386 | 387 | try { 388 | JSONObject jobj = new JSONObject(result.getResult()); 389 | UploadTask.this.msg = jobj.getString("response"); 390 | } 391 | catch (Exception e1) 392 | { 393 | UploadTask.this.msg= "Check Your Internet Connection - "+e1.getMessage(); 394 | } 395 | 396 | } 397 | }); 398 | } catch (Exception e1) { 399 | 400 | msg= "Check Your Internet Connection - "+e1.getMessage(); 401 | 402 | } 403 | return msg; 404 | } 405 | 406 | @Override 407 | protected void onPreExecute() { 408 | 409 | progressDialog = new ProgressDialog(ProfileActivity.this); 410 | progressDialog.setMessage("Uploading..."); 411 | progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); 412 | progressDialog.setIndeterminate(true); 413 | progressDialog.setCanceledOnTouchOutside(false); 414 | progressDialog.show(); 415 | } 416 | 417 | @Override 418 | protected void onPostExecute(String aVoid) { 419 | progressDialog.dismiss(); 420 | 421 | Toast.makeText(getApplication(),aVoid, Toast.LENGTH_SHORT).show(); 422 | 423 | } 424 | } 425 | 426 | class FilesAdapter extends ArrayAdapter 427 | { 428 | FilesAdapter() 429 | { 430 | super(getApplicationContext(), R.layout.files_name,files); 431 | } 432 | @Override 433 | public int getCount() { 434 | return files.length; 435 | } 436 | 437 | 438 | 439 | @Override 440 | public View getView(int position, View convertView, ViewGroup parent) { 441 | if (convertView == null) { 442 | LayoutInflater layoutInflater = ProfileActivity.this.getLayoutInflater(); 443 | convertView = layoutInflater.inflate(R.layout.files_name, parent, false); 444 | } 445 | if(position { 456 | 457 | @Override 458 | protected void onPreExecute() { 459 | progressDialog = new ProgressDialog(ProfileActivity.this); 460 | progressDialog.setMessage("Downloading..."); 461 | progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); 462 | progressDialog.setIndeterminate(true); 463 | progressDialog.setCanceledOnTouchOutside(false); 464 | progressDialog.show(); 465 | 466 | } 467 | 468 | @Override 469 | protected String doInBackground(String... aurl) { 470 | int count; 471 | 472 | try { 473 | 474 | URL url = new URL(aurl[0]); 475 | URLConnection conexion = url.openConnection(); 476 | conexion.connect(); 477 | 478 | int lenghtOfFile = conexion.getContentLength(); 479 | Log.d("ANDRO_ASYNC", "Lenght of file: " + lenghtOfFile); 480 | 481 | InputStream input = new BufferedInputStream(url.openStream()); 482 | OutputStream output = new FileOutputStream("/sdcard/download/"+file_to_download); 483 | 484 | byte data[] = new byte[128*1024]; 485 | 486 | long total = 0; 487 | 488 | while ((count = input.read(data)) != -1) { 489 | total += count; 490 | publishProgress(""+(int)((total*100)/lenghtOfFile)); 491 | output.write(data, 0, count); 492 | } 493 | 494 | output.flush(); 495 | output.close(); 496 | input.close(); 497 | } catch (Exception e) { 498 | return e.getMessage(); 499 | } 500 | return null; 501 | 502 | } 503 | protected void onProgressUpdate(String... progress) { 504 | Log.d("ANDRO_ASYNC",progress[0]); 505 | progressDialog.setProgress(Integer.parseInt(progress[0])); 506 | } 507 | 508 | @Override 509 | protected void onPostExecute(String unused) { 510 | 511 | progressDialog.dismiss(); 512 | if(unused==null) 513 | Toast.makeText(getApplication(), "downloaded", Toast.LENGTH_SHORT).show(); 514 | else 515 | Toast.makeText(getApplication(), unused, Toast.LENGTH_SHORT).show(); 516 | } 517 | } 518 | 519 | 520 | class JP extends AsyncTask 521 | { 522 | String res=""; 523 | @Override 524 | protected String doInBackground(String... params) { 525 | try{ 526 | 527 | Document doc=Jsoup.connect("https://www.webrtc-experiment.com/webrtc-broadcasting/").get(); 528 | res=doc.getElementById("room-list").data(); 529 | }catch(Exception e) 530 | { 531 | res=e.getMessage(); 532 | } 533 | return res; 534 | } 535 | 536 | @Override 537 | protected void onPostExecute(String s) { 538 | Toast.makeText(getApplication(),s,Toast.LENGTH_LONG).show(); 539 | progressDialog.dismiss(); 540 | } 541 | 542 | @Override 543 | protected void onPreExecute() { 544 | progressDialog = new ProgressDialog(ProfileActivity.this); 545 | progressDialog.setMessage("Extracting Details..."); 546 | progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); 547 | progressDialog.setIndeterminate(true); 548 | progressDialog.setCanceledOnTouchOutside(false); 549 | progressDialog.show(); 550 | 551 | } 552 | } 553 | 554 | 555 | } 556 | -------------------------------------------------------------------------------- /Android Client/java/com/virtualclassroom/main/virtualclassroom/Question.java: -------------------------------------------------------------------------------- 1 | package com.virtualclassroom.main.virtualclassroom; 2 | 3 | import android.app.ActionBar; 4 | import android.app.Dialog; 5 | import android.app.ProgressDialog; 6 | import android.content.Intent; 7 | import android.content.SharedPreferences; 8 | import android.os.AsyncTask; 9 | import android.os.Bundle; 10 | import android.support.design.widget.FloatingActionButton; 11 | import android.support.design.widget.Snackbar; 12 | import android.support.v7.app.AppCompatActivity; 13 | import android.support.v7.widget.Toolbar; 14 | import android.util.Log; 15 | import android.view.LayoutInflater; 16 | import android.view.View; 17 | import android.view.ViewGroup; 18 | import android.widget.AbsListView; 19 | import android.widget.AdapterView; 20 | import android.widget.ArrayAdapter; 21 | import android.widget.Button; 22 | import android.widget.EditText; 23 | import android.widget.LinearLayout; 24 | import android.widget.ListView; 25 | import android.widget.TextView; 26 | import android.widget.Toast; 27 | 28 | import com.virtualclassroom.main.ServerRequest; 29 | 30 | import org.apache.http.NameValuePair; 31 | import org.apache.http.message.BasicNameValuePair; 32 | import org.json.JSONException; 33 | import org.json.JSONObject; 34 | 35 | import java.util.ArrayList; 36 | import java.util.Arrays; 37 | import java.util.Iterator; 38 | import java.util.List; 39 | 40 | public class Question extends AppCompatActivity { 41 | 42 | TextView quesEmail,ques,ansCount; 43 | List params; 44 | EditText ans; 45 | Button submit,clear,send,cancel; 46 | SharedPreferences pref; 47 | Dialog Answer; 48 | String response="",myemail,answ,ansUser,Global_Separator="1111111111",result=""; 49 | int Global_Separator_count=10; 50 | List totalAnswers,totalUsers; 51 | ListView responseList; 52 | ProgressDialog progressDialog; 53 | String[] responses; 54 | @Override 55 | protected void onCreate(Bundle savedInstanceState) { 56 | super.onCreate(savedInstanceState); 57 | progressDialog = new ProgressDialog(this); 58 | progressDialog.setMessage("Please Wait..."); 59 | progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); 60 | progressDialog.setIndeterminate(true); 61 | progressDialog.setCanceledOnTouchOutside(false); 62 | 63 | setContentView(R.layout.activity_question); 64 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 65 | setSupportActionBar(toolbar); 66 | quesEmail=(TextView)findViewById(R.id.questionUser); 67 | ques=(TextView)findViewById(R.id.question); 68 | ansCount=(TextView)findViewById(R.id.anscount); 69 | responseList=(ListView)findViewById(R.id.response_list); 70 | responseList.setOnItemClickListener(new AdapterView.OnItemClickListener() { 71 | @Override 72 | public void onItemClick(AdapterView parent, View view, int position, long id) { 73 | String item[]=parent.getItemAtPosition(parent.getCount() - 1 - position).toString().trim().split(Global_Separator); 74 | SharedPreferences.Editor edit = pref.edit(); 75 | edit.putString("email",item[0]); 76 | edit.putString("contents", item[1]); 77 | edit.commit(); 78 | Intent i=new Intent(Question.this.getBaseContext(),ResponseDetails.class); 79 | startActivity(i); 80 | } 81 | }); 82 | submit=(Button)findViewById(R.id.submit_answer); 83 | pref = getSharedPreferences("AppPref", MODE_PRIVATE); 84 | quesEmail.setText(pref.getString("emailFromForum","Anonymus")); 85 | ques.setText(pref.getString("quesFromForum","")); 86 | myemail=pref.getString("email", "Anonymous"); 87 | 88 | answ=pref.getString("ansFromForum","").trim(); 89 | ansUser=pref.getString("ansUserFromForum","").trim(); 90 | 91 | submit.setOnClickListener(new View.OnClickListener() { 92 | @Override 93 | public void onClick(View v) { 94 | 95 | Answer = new Dialog(Question.this); 96 | Answer.setTitle("Your Answer..."); 97 | Answer.setContentView(R.layout.forum_answer); 98 | clear = (Button)Answer.findViewById(R.id.clearbtn); 99 | send = (Button)Answer.findViewById(R.id.submitbtn); 100 | ans=(EditText)Answer.findViewById(R.id.answer); 101 | ans.setText(response); 102 | cancel = (Button)Answer.findViewById(R.id.cancel); 103 | cancel.setOnClickListener(new View.OnClickListener() { 104 | @Override 105 | public void onClick(View view) { 106 | if(!ans.getText().toString().trim().equals("")) 107 | response=ans.getText().toString().trim(); 108 | Answer.dismiss(); 109 | } 110 | }); 111 | clear.setOnClickListener(new View.OnClickListener() { 112 | @Override 113 | public void onClick(View v) { 114 | ans.setText(""); 115 | response=""; 116 | } 117 | }); 118 | send.setOnClickListener(new View.OnClickListener() { 119 | @Override 120 | public void onClick(View v) { 121 | if (ans.getText().toString().trim().equals("")) 122 | Toast.makeText(getApplicationContext(), "Write Someting...", Toast.LENGTH_LONG).show(); 123 | else { 124 | submitResponse(); 125 | Answer.dismiss(); 126 | } 127 | } 128 | }); 129 | Answer.show(); 130 | } 131 | }); 132 | new CountResponses().execute(); 133 | 134 | } 135 | 136 | public void submitResponse() 137 | { 138 | progressDialog = new ProgressDialog(this); 139 | progressDialog.setMessage("Uploading..."); 140 | progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); 141 | progressDialog.setIndeterminate(true); 142 | progressDialog.setCanceledOnTouchOutside(false); 143 | progressDialog.show(); 144 | final Thread t=new Thread() 145 | { 146 | public void run() 147 | { 148 | answ += ans.getText().toString().trim()+Global_Separator ; 149 | ansUser += myemail+Global_Separator ; 150 | params = new ArrayList(); 151 | pref = getSharedPreferences("AppPref", MODE_PRIVATE); 152 | myemail = pref.getString("email", ""); 153 | params.add(new BasicNameValuePair("quesUser", quesEmail.getText().toString())); 154 | params.add(new BasicNameValuePair("ques", ques.getText().toString())); 155 | params.add(new BasicNameValuePair("ans", answ)); 156 | params.add(new BasicNameValuePair("ansUser", ansUser)); 157 | ServerRequest sr = new ServerRequest(); 158 | // JSONObject json = sr.getJSON("http://192.168.56.1:8080/api/chgpass",params); 159 | JSONObject json = sr.getJSON("http://192.168.43.101:8080/registerAnswer", params); 160 | if (json != null) { 161 | try { 162 | String jsonstr = json.getString("response"); 163 | result=jsonstr; 164 | } catch (JSONException e) { 165 | result="Exception - "+e.getMessage(); 166 | } 167 | } 168 | runOnUiThread(new Runnable() { 169 | @Override 170 | public void run() { 171 | progressDialog.dismiss(); 172 | Toast.makeText(getApplicationContext(), result, Toast.LENGTH_LONG); 173 | if( Answer.isShowing()) 174 | Answer.dismiss(); 175 | if(result.toLowerCase().contains("exception")==false) { 176 | getAnswersList(); 177 | } 178 | 179 | } 180 | }); 181 | } 182 | }; 183 | t.setDaemon(true); 184 | t.start(); 185 | 186 | } 187 | 188 | 189 | 190 | public void getAnswersList() { 191 | 192 | progressDialog = new ProgressDialog(this); 193 | progressDialog.setMessage("Please Wait..."); 194 | progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); 195 | progressDialog.setIndeterminate(true); 196 | progressDialog.setCanceledOnTouchOutside(false); 197 | progressDialog.show(); 198 | 199 | final Thread t = new Thread() { 200 | public void run() { 201 | 202 | 203 | params = new ArrayList(); 204 | ServerRequest sr = new ServerRequest(); 205 | // JSONObject json = sr.getJSON("http://192.168.56.1:8080/api/chgpass",params); 206 | JSONObject json = sr.getJSON("http://192.168.43.101:8080/forumList", params); 207 | if (json != null) { 208 | try { 209 | 210 | int len = json.length(); 211 | 212 | Iterator iterator = json.keys(); 213 | while (iterator.hasNext()) { 214 | JSONObject jsonObject = json.getJSONObject(iterator.next()); 215 | 216 | if(jsonObject.getString("quesUser").equals(myemail) && jsonObject.getString("ques").equals(ques.getText().toString().trim())) 217 | { 218 | answ=jsonObject.getString("ans"); 219 | ansUser=jsonObject.getString("ansUser"); 220 | } 221 | 222 | } 223 | 224 | } catch (JSONException e) { 225 | 226 | } 227 | 228 | } 229 | 230 | runOnUiThread(new Runnable() { 231 | @Override 232 | public void run() { 233 | Toast.makeText(getApplicationContext(), "Populating List...\n PLease Wait...", Toast.LENGTH_LONG); 234 | progressDialog.dismiss(); 235 | progressDialog=null; 236 | new CountResponses().execute(); 237 | Toast.makeText(getApplicationContext(), result, Toast.LENGTH_LONG); 238 | 239 | 240 | } 241 | }); 242 | 243 | 244 | } 245 | 246 | 247 | }; 248 | t.setDaemon(true); 249 | t.start(); 250 | 251 | 252 | 253 | } 254 | class ResponseAdapter extends ArrayAdapter 255 | { 256 | 257 | ResponseAdapter() 258 | { 259 | 260 | 261 | super(getApplicationContext(), R.layout.response_list_items, responses); 262 | } 263 | 264 | @Override 265 | public int getCount() { 266 | return responses.length; 267 | } 268 | 269 | 270 | @Override 271 | public View getView(int position, View convertView, ViewGroup parent) { 272 | if (convertView == null) { 273 | LayoutInflater layoutInflater = Question.this.getLayoutInflater(); 274 | convertView = layoutInflater.inflate(R.layout.simple_list_view, parent, false); 275 | } 276 | if (position < getCount()) { 277 | String string[]=responses[getCount() - 1 - position].trim().split(Global_Separator); 278 | TextView firstLine = (TextView) convertView.findViewById(R.id.email); 279 | TextView secondLine = (TextView) convertView.findViewById(R.id.contents); 280 | firstLine.setText(string[0].trim()); 281 | secondLine.setText(string[1].trim()); 282 | } 283 | return convertView; 284 | } 285 | } 286 | 287 | class CountResponses extends AsyncTask 288 | { 289 | @Override 290 | protected void onPreExecute() { 291 | if(progressDialog==null || progressDialog.isShowing()==false) { 292 | progressDialog = new ProgressDialog(Question.this); 293 | progressDialog.setMessage("Please Wait..."); 294 | progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); 295 | progressDialog.setIndeterminate(true); 296 | progressDialog.setCanceledOnTouchOutside(false); 297 | progressDialog.show(); 298 | } 299 | 300 | } 301 | 302 | @Override 303 | protected void onPostExecute(String[] res) { 304 | if(res!=null) { 305 | ansCount.setText("Total Responses = " + totalUsers.size()); 306 | responses = res; 307 | responseList.setAdapter(new ResponseAdapter()); 308 | 309 | } 310 | else 311 | Toast.makeText(getApplicationContext(), 0 + " Records Available", Toast.LENGTH_LONG); 312 | progressDialog.dismiss(); 313 | } 314 | 315 | @Override 316 | protected String[] doInBackground(Void... params) { 317 | 318 | 319 | if(answ.equals("")) 320 | return null; 321 | 322 | 323 | totalAnswers= (Arrays.asList(answ.trim().split(Global_Separator))); 324 | totalUsers=(Arrays.asList(ansUser.trim().split(Global_Separator))); 325 | 326 | String res[]=new String[totalAnswers.size()]; 327 | try { 328 | for (int i = 0; i < totalAnswers.size(); i++) 329 | res[i] = totalUsers.get(i) + Global_Separator + totalAnswers.get(i); 330 | 331 | }catch (Exception e) 332 | { 333 | Log.e("Error ",e.getMessage()); 334 | } 335 | 336 | return res; 337 | } 338 | } 339 | } 340 | 341 | 342 | 343 | -------------------------------------------------------------------------------- /Android Client/java/com/virtualclassroom/main/virtualclassroom/RegisterActivity.java: -------------------------------------------------------------------------------- 1 | package com.virtualclassroom.main.virtualclassroom; 2 | 3 | import android.app.ProgressDialog; 4 | import android.content.SharedPreferences; 5 | import android.os.Bundle; 6 | import android.support.design.widget.FloatingActionButton; 7 | import android.support.design.widget.Snackbar; 8 | import android.support.v7.app.AppCompatActivity; 9 | import android.support.v7.widget.Toolbar; 10 | import android.view.View; 11 | 12 | import com.virtualclassroom.main.ServerRequest; 13 | 14 | 15 | import android.app.Activity; 16 | import android.content.Intent; 17 | import android.os.Bundle; 18 | import android.util.Log; 19 | import android.view.View; 20 | import android.widget.Button; 21 | import android.widget.EditText; 22 | import android.widget.TextView; 23 | import android.widget.Toast; 24 | 25 | import org.apache.http.NameValuePair; 26 | import org.apache.http.message.BasicNameValuePair; 27 | import org.json.JSONException; 28 | import org.json.JSONObject; 29 | 30 | import java.util.ArrayList; 31 | import java.util.List; 32 | public class RegisterActivity extends AppCompatActivity { 33 | EditText email, password, name, branch; 34 | Button login, register; 35 | String emailtxt, passwordtxt, nametxt, branchtxt, k; 36 | List params; 37 | SharedPreferences pref; 38 | ProgressDialog progressDialog; 39 | String jsonstr; 40 | TextView error; 41 | @Override 42 | protected void onCreate(Bundle savedInstanceState) { 43 | super.onCreate(savedInstanceState); 44 | setContentView(R.layout.activity_register); 45 | Intent i = getIntent(); 46 | Bundle b = i.getExtras(); 47 | if (b != null) 48 | k = (String) b.get("name"); 49 | email = (EditText) findViewById(R.id.email); 50 | password = (EditText) findViewById(R.id.password); 51 | name = (EditText) findViewById(R.id.name); 52 | branch = (EditText) findViewById(R.id.branch); 53 | error=(TextView)findViewById(R.id.error); 54 | register = (Button) findViewById(R.id.registerbtn); 55 | login = (Button) findViewById(R.id.login); 56 | 57 | login.setOnClickListener(new View.OnClickListener() { 58 | @Override 59 | public void onClick(View view) { 60 | Intent regactivity = new Intent(RegisterActivity.this, LoginActivity.class); 61 | startActivity(regactivity); 62 | finish(); 63 | } 64 | }); 65 | 66 | 67 | register.setOnClickListener(new View.OnClickListener() { 68 | 69 | @Override 70 | public void onClick(View view) { 71 | 72 | 73 | Register(); 74 | } 75 | }); 76 | login.setVisibility(View.INVISIBLE); 77 | } 78 | 79 | 80 | public void Register() { 81 | progressDialog = new ProgressDialog(this); 82 | progressDialog.setMessage("Registering..."); 83 | progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); 84 | progressDialog.setIndeterminate(true); 85 | progressDialog.setCanceledOnTouchOutside(false); 86 | progressDialog.show(); 87 | 88 | final Thread t = new Thread() { 89 | public void run() { 90 | JSONObject json; 91 | emailtxt = email.getText().toString(); 92 | passwordtxt = password.getText().toString(); 93 | nametxt = name.getText().toString(); 94 | branchtxt = branch.getText().toString(); 95 | params = new ArrayList(); 96 | params.add(new BasicNameValuePair("email", emailtxt)); 97 | params.add(new BasicNameValuePair("password", passwordtxt)); 98 | params.add(new BasicNameValuePair("name", nametxt)); 99 | params.add(new BasicNameValuePair("branch", branchtxt)); 100 | 101 | ServerRequest sr = new ServerRequest(); 102 | if (k.toUpperCase().equals("FACULTY")) 103 | json = sr.getJSON("http://192.168.43.101:8080/registerFaculty", params); 104 | 105 | else 106 | json = sr.getJSON("http://192.168.43.101:8080/register", params); 107 | //JSONObject json = sr.getJSON("http://192.168.56.1:8080/register",params); 108 | 109 | if (json != null) { 110 | try { 111 | jsonstr = json.getString("response"); 112 | 113 | 114 | // Log.d("Hello", jsonstr); 115 | } catch (JSONException e) { 116 | jsonstr=e.getMessage(); 117 | //Toast.makeText(getApplication(), e.getMessage(), Toast.LENGTH_LONG).show(); 118 | 119 | } 120 | } 121 | runOnUiThread(new Runnable() { 122 | @Override 123 | public void run() { 124 | progressDialog.dismiss(); 125 | Toast.makeText(getApplication(), jsonstr, Toast.LENGTH_SHORT).show(); 126 | if(jsonstr.contains("Sucessfully")) 127 | { 128 | email.setText(""); 129 | password.setText(""); 130 | name.setText(""); 131 | branch.setText(""); 132 | 133 | } 134 | else 135 | { 136 | email.setText(""); 137 | password.setText(""); 138 | } 139 | } 140 | }); 141 | 142 | } 143 | }; 144 | t.setDaemon(true); 145 | t.start(); 146 | 147 | } 148 | } 149 | 150 | 151 | 152 | 153 | 154 | -------------------------------------------------------------------------------- /Android Client/java/com/virtualclassroom/main/virtualclassroom/ResponseDetails.java: -------------------------------------------------------------------------------- 1 | package com.virtualclassroom.main.virtualclassroom; 2 | 3 | import android.content.SharedPreferences; 4 | import android.os.Bundle; 5 | import android.support.design.widget.FloatingActionButton; 6 | import android.support.design.widget.Snackbar; 7 | import android.support.v7.app.AppCompatActivity; 8 | import android.support.v7.widget.Toolbar; 9 | import android.view.View; 10 | import android.webkit.WebView; 11 | import android.widget.TextView; 12 | 13 | public class ResponseDetails extends AppCompatActivity { 14 | TextView email,contents; 15 | SharedPreferences pref; 16 | @Override 17 | protected void onCreate(Bundle savedInstanceState) { 18 | super.onCreate(savedInstanceState); 19 | setContentView(R.layout.activity_response_details); 20 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); 21 | setSupportActionBar(toolbar); 22 | pref = getSharedPreferences("AppPref", MODE_PRIVATE); 23 | 24 | email=(TextView)findViewById(R.id.email); 25 | contents=(TextView)findViewById(R.id.contents); 26 | email.setText(pref.getString("email","Anonymous").trim()); 27 | contents.setText(pref.getString("contents","").trim()); 28 | 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /Android Client/java/com/virtualclassroom/main/virtualclassroom/VideoShow.java: -------------------------------------------------------------------------------- 1 | package com.virtualclassroom.main.virtualclassroom; 2 | 3 | import android.content.SharedPreferences; 4 | import android.content.pm.ActivityInfo; 5 | import android.media.MediaPlayer; 6 | import android.os.Bundle; 7 | import android.support.design.widget.FloatingActionButton; 8 | import android.support.design.widget.Snackbar; 9 | import android.support.v7.app.AppCompatActivity; 10 | import android.support.v7.widget.Toolbar; 11 | import android.view.View; 12 | import android.media.MediaPlayer; 13 | import android.media.MediaPlayer.OnPreparedListener; 14 | import android.net.Uri; 15 | import android.os.Bundle; 16 | import android.app.Activity; 17 | import android.app.ProgressDialog; 18 | import android.util.Log; 19 | import android.webkit.WebChromeClient; 20 | import android.webkit.WebSettings; 21 | import android.webkit.WebView; 22 | import android.webkit.WebViewClient; 23 | import android.widget.MediaController; 24 | import android.widget.VideoView; 25 | 26 | import org.jsoup.Jsoup; 27 | import org.w3c.dom.Document; 28 | 29 | public class VideoShow extends AppCompatActivity { 30 | ProgressDialog pDialog; 31 | VideoView videoview; 32 | WebView webView; 33 | SharedPreferences pref; 34 | ProgressDialog progressDialog; 35 | String VideoURL = ""; 36 | @Override 37 | protected void onCreate(Bundle savedInstanceState) { 38 | super.onCreate(savedInstanceState); 39 | this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); 40 | setContentView(R.layout.activity_video_show); 41 | webView = (WebView) findViewById(R.id.VideoView); 42 | pref = getSharedPreferences("AppPref", MODE_PRIVATE); 43 | VideoURL=VideoURL+pref.getString("file",""); 44 | startWebView(VideoURL); 45 | } 46 | 47 | 48 | 49 | 50 | private void startWebView(String url) { 51 | webView.setWebViewClient(new WebViewClient() { 52 | 53 | public boolean shouldOverrideUrlLoading(WebView view, String url) { 54 | view.loadUrl(url); 55 | return true; 56 | } 57 | 58 | public void onLoadResource(WebView view, String url) { 59 | if (progressDialog == null) { 60 | progressDialog = new ProgressDialog(VideoShow.this); 61 | progressDialog.setMessage("Loading..."); 62 | progressDialog.setCanceledOnTouchOutside(false); 63 | progressDialog.show(); 64 | } 65 | } 66 | 67 | public void onPageFinished(WebView view, String url) { 68 | try { 69 | 70 | if(progressDialog.isShowing()) 71 | progressDialog.dismiss(); 72 | } catch (Exception exception) { 73 | exception.printStackTrace(); 74 | } 75 | } 76 | 77 | }); 78 | 79 | webView.setWebChromeClient(new WebChromeClient()); 80 | webView.getSettings().setJavaScriptEnabled(true); 81 | webView.getSettings().setLoadWithOverviewMode(true); 82 | webView.getSettings().setUseWideViewPort(true); 83 | webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); 84 | webView.setScrollbarFadingEnabled(false); 85 | webView.getSettings().setBuiltInZoomControls(true); 86 | webView.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN); 87 | webView.getSettings().setAllowUniversalAccessFromFileURLs(true); 88 | webView.loadUrl(url); 89 | 90 | 91 | } 92 | 93 | class MyWebChromeClient extends WebChromeClient 94 | { 95 | 96 | } 97 | 98 | 99 | @Override 100 | protected void onPostResume() { 101 | super.onPostResume(); 102 | startWebView(VideoURL); 103 | } 104 | 105 | @Override 106 | public void onBackPressed() { 107 | 108 | webView.clearSslPreferences(); 109 | webView.clearCache(true); 110 | webView.removeAllViews(); 111 | webView.destroy(); 112 | finish(); 113 | } 114 | } 115 | 116 | 117 | -------------------------------------------------------------------------------- /Android Client/res/layout/activity_forum.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Android Client/res/layout/activity_lecture.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Android Client/res/layout/activity_login.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 19 | 25 | 26 | 27 | 34 | 35 | 42 | 43 | 52 | 90 | 91 | 92 | 93 |
94 | 95 | 96 |
97 | 98 | 99 | 262 | 263 | 264 | 265 | 266 | --------------------------------------------------------------------------------