Advertisement
Guest User

Untitled

a guest
May 21st, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.66 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  3. package="com.example.champ.remindme">
  4.  
  5. <!-- To auto-complete the email text field in the login form with the user's emails -->
  6. <uses-permission android:name="android.permission.GET_ACCOUNTS" />
  7. <uses-permission android:name="android.permission.READ_PROFILE" />
  8. <uses-permission android:name="android.permission.READ_CONTACTS" />
  9.  
  10. <!--
  11. The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
  12. Google Maps Android API v2, but you must specify either coarse or fine
  13. location permissions for the 'MyLocation' functionality.
  14. -->
  15. <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  16.  
  17. <application
  18. android:allowBackup="true"
  19. android:icon="@mipmap/ic_launcher"
  20. android:label="@string/app_name"
  21. android:supportsRtl="true"
  22. android:theme="@style/AppTheme">
  23. <activity android:name=".Login">
  24. <intent-filter>
  25. <action android:name="android.intent.action.MAIN" />
  26.  
  27. <category android:name="android.intent.category.LAUNCHER" />
  28. </intent-filter>
  29. </activity>
  30. <!-- <activity android:name=".Login" /> -->
  31. <activity android:name=".Menu" />
  32. <activity android:name=".AddReminder" />
  33. <!--
  34. The API key for Google Maps-based APIs is defined as a string resource.
  35. (See the file "res/values/google_maps_api.xml").
  36. Note that the API key is linked to the encryption key used to sign the APK.
  37. You need a different API key for each encryption key, including the release key that is used to
  38. sign the APK for publishing.
  39. You can define the keys for the debug and release targets in src/debug/ and src/release/.
  40. -->
  41. <meta-data
  42. android:name="com.google.android.geo.API_KEY"
  43. android:value="@string/google_maps_key" />
  44.  
  45. <activity
  46. android:name=".AddEventPlace"
  47. android:label="@string/title_activity_add_event_place" />
  48. <activity android:name=".SignUp"></activity>
  49. </application>
  50.  
  51. </manifest>
  52.  
  53. <?xml version="1.0" encoding="utf-8"?>
  54.  
  55. <!-- To auto-complete the email text field in the login form with the user's emails -->
  56. <uses-permission android:name="android.permission.GET_ACCOUNTS" />
  57. <uses-permission android:name="android.permission.READ_PROFILE" />
  58. <uses-permission android:name="android.permission.READ_CONTACTS" />
  59.  
  60. <!--
  61. The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
  62. Google Maps Android API v2, but you must specify either coarse or fine
  63. location permissions for the 'MyLocation' functionality.
  64. -->
  65. <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
  66.  
  67. <application
  68. android:allowBackup="true"
  69. android:icon="@mipmap/ic_launcher"
  70. android:label="@string/app_name"
  71. android:supportsRtl="true"
  72. android:theme="@style/AppTheme">
  73. <activity android:name=".Login">
  74. <intent-filter>
  75. <action android:name="android.intent.action.MAIN" />
  76.  
  77. <category android:name="android.intent.category.LAUNCHER" />
  78. </intent-filter>
  79. </activity>
  80. <!-- <activity android:name=".Login" /> -->
  81. <activity android:name=".Menu" />
  82. <activity android:name=".AddReminder" />
  83. <!--
  84. The API key for Google Maps-based APIs is defined as a string resource.
  85. (See the file "res/values/google_maps_api.xml").
  86. Note that the API key is linked to the encryption key used to sign the APK.
  87. You need a different API key for each encryption key, including the release key that is used to
  88. sign the APK for publishing.
  89. You can define the keys for the debug and release targets in src/debug/ and src/release/.
  90. -->
  91. <meta-data
  92. android:name="com.google.android.geo.API_KEY"
  93. android:value="@string/google_maps_key" />
  94.  
  95. <activity
  96. android:name=".AddEventPlace"
  97. android:label="@string/title_activity_add_event_place" />
  98. <activity android:name=".SignUp"></activity>
  99. </application>
  100.  
  101. </manifest>
  102.  
  103. package com.example.champ.remindme;
  104. import android.app.AlertDialog;
  105. import android.content.Context;
  106. import android.database.sqlite.SQLiteDatabase;
  107. import android.os.Bundle;
  108. import android.support.v7.app.AppCompatActivity;
  109. import android.view.View;
  110. import android.widget.Button;
  111. import android.widget.EditText;
  112.  
  113. public class SignUp extends AppCompatActivity {
  114. EditText editUsername,editPassword,editEmail,editMobileNumber;
  115. Button btnSignUpButton;
  116. SQLiteDatabase db;
  117. @Override
  118. protected void onCreate(Bundle savedInstanceState) {
  119. super.onCreate(savedInstanceState);
  120. setContentView(R.layout.activity_sign_up);
  121. editUsername = (EditText)findViewById(R.id.editUsername);
  122. editPassword = (EditText)findViewById(R.id.editPassword);
  123. editEmail = (EditText)findViewById(R.id.editEmail);
  124. editMobileNumber = (EditText)findViewById(R.id.editMobileNumber);
  125. btnSignUpButton = (Button)findViewById(R.id.btnSiginUpButton);
  126. db=openOrCreateDatabase("RemindMe", Context.MODE_PRIVATE, null);
  127. db.execSQL("create table IF NOT EXISTS User (Username TEXT PRIMARY KEY," +
  128. "Password TEXT," +
  129. "Email TEXT," +
  130. "MobileNumber Integer )");
  131. }
  132. public void AddUser(View v){
  133. if(editUsername.length()==0||
  134. editPassword.length()==0||
  135. editEmail.length()==0||
  136. editMobileNumber.length()==0)
  137. {
  138. showMessage("Error", "Please enter all values");
  139. return;
  140. }
  141. db.execSQL("INSERT INTO User VALUES('"+editUsername+"'," +
  142. "'"+editPassword+ "'," +
  143. "'"+editEmail+"',"+
  144. "'"+editEmail+"',"+
  145. "');");
  146.  
  147. showMessage("Success", "Record added");
  148. }
  149.  
  150. public void showMessage(String title,String message)
  151. {
  152. AlertDialog.Builder builder=new AlertDialog.Builder(this);
  153. builder.setCancelable(true);
  154. builder.setTitle(title);
  155. builder.setMessage(message);
  156. builder.show();
  157. }
  158.  
  159. <?xml version="1.0" encoding="utf-8"?>
  160. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  161. xmlns:tools="http://schemas.android.com/tools"
  162. android:layout_width="match_parent"
  163. android:layout_height="match_parent"
  164. android:paddingBottom="@dimen/activity_vertical_margin"
  165. android:paddingLeft="@dimen/activity_horizontal_margin"
  166. android:paddingRight="@dimen/activity_horizontal_margin"
  167. android:paddingTop="@dimen/activity_vertical_margin"
  168. tools:context=".SignUp"
  169. android:background="@drawable/back">
  170.  
  171. <ImageView
  172. android:layout_width="wrap_content"
  173. android:layout_height="wrap_content"
  174. android:id="@+id/imageView5"
  175. android:src="@drawable/remind_me_logo"
  176. android:layout_alignParentTop="true"
  177. android:layout_centerHorizontal="true" />
  178.  
  179. <EditText
  180. android:id="@+id/editUsername"
  181. android:layout_width="265dp"
  182. android:layout_height="wrap_content"
  183. android:padding="15dip"
  184. android:background="@drawable/username_rounded_edited_text"
  185. android:inputType="text"
  186. android:hint="Username"
  187. android:textAlignment="center"
  188. android:layout_below="@+id/imageView5"
  189. android:layout_centerHorizontal="true"
  190. android:layout_marginTop="38dp" />
  191. <EditText
  192. android:id="@+id/editPassword"
  193. android:layout_width="265dp"
  194. android:layout_height="wrap_content"
  195. android:padding="15dip"
  196. android:background="@drawable/input_felid"
  197. android:inputType="textVisiblePassword"
  198. android:hint="Password"
  199. android:textAlignment="center"
  200. android:layout_below="@+id/editUsername"
  201. android:layout_alignLeft="@+id/editUsername"
  202. android:layout_alignStart="@+id/editUsername" />
  203. <EditText
  204. android:id="@+id/editConfrimPassword"
  205. android:layout_width="265dp"
  206. android:layout_height="wrap_content"
  207. android:padding="15dip"
  208. android:background="@drawable/input_felid"
  209. android:inputType="textVisiblePassword"
  210. android:hint="Confrim Password"
  211. android:textAlignment="center"
  212. android:layout_below="@+id/editPassword"
  213. android:layout_alignLeft="@+id/editPassword"
  214. android:layout_alignStart="@+id/editPassword" />
  215. <EditText
  216. android:id="@+id/editEmail"
  217. android:layout_width="265dp"
  218. android:layout_height="wrap_content"
  219. android:padding="15dip"
  220. android:background="@drawable/input_felid"
  221. android:inputType="textWebEmailAddress"
  222. android:hint="Email"
  223. android:textAlignment="center"
  224. android:layout_below="@+id/editConfrimPassword"
  225. android:layout_centerHorizontal="true" />
  226. <EditText
  227. android:id="@+id/editMobileNumber"
  228. android:layout_width="265dp"
  229. android:layout_height="wrap_content"
  230. android:padding="15dip"
  231. android:background="@drawable/pass_rounded_edited_text"
  232. android:inputType="number"
  233. android:hint="Contact Number"
  234. android:textAlignment="center"
  235. android:layout_below="@+id/editEmail"
  236. android:layout_centerHorizontal="true" />
  237.  
  238. <CheckBox
  239. android:layout_width="wrap_content"
  240. android:layout_height="wrap_content"
  241. android:text="I agree the terms and condiations"
  242. android:id="@+id/checkBox"
  243. style="@style/ButtonText"
  244. android:textSize="18dp"
  245. android:checked="false"
  246. android:layout_below="@+id/editMobileNumber"
  247. android:layout_alignLeft="@+id/btnSiginUpButton"
  248. android:layout_alignStart="@+id/btnSiginUpButton" />
  249. <Button
  250. android:id="@+id/btnSiginUpButton"
  251. android:background="@drawable/blue_botton"
  252. android:layout_width="wrap_content"
  253. android:layout_height="wrap_content"
  254. android:text="@string/signUp"
  255. style="@style/ButtonText"
  256. android:onClick="AddUser"
  257. android:layout_below="@+id/checkBox"
  258. android:layout_alignLeft="@+id/editMobileNumber"
  259. android:layout_alignStart="@+id/editMobileNumber"
  260. android:layout_alignRight="@+id/editMobileNumber"
  261. android:layout_alignEnd="@+id/editMobileNumber" />
  262. </RelativeLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement