Skip to content

Commit

Permalink
디비연결
Browse files Browse the repository at this point in the history
  • Loading branch information
tarahjjeon committed Jun 5, 2018
1 parent 5f22dba commit d5483a8
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 1 deletion.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
4 changes: 4 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

apply plugin: 'com.google.gms.google-services'
59 changes: 59 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"project_info": {
"project_number": "223306660274",
"firebase_url": "https://aptmanager-c479c.firebaseio.com",
"project_id": "aptmanager-c479c",
"storage_bucket": "aptmanager-c479c.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:223306660274:android:2ad07d48e20049f8",
"android_client_info": {
"package_name": "com.example.tarah.apartmentmanager"
}
},
"oauth_client": [
{
"client_id": "223306660274-jg61nqh8i694emg4bupvf6inq1ag6e32.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.example.tarah.apartmentmanager",
"certificate_hash": "80164e3e131b709a298ebe858a2787f683dc875f"
}
},
{
"client_id": "223306660274-ig1s9ne66dq21971sdh2hhgu339dhk7b.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "223306660274-ig1s9ne66dq21971sdh2hhgu339dhk7b.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDKiyY8I8ZksX24HfOYavBG-PZGZFO4U9s"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 2,
"other_platform_oauth_client": [
{
"client_id": "223306660274-ig1s9ne66dq21971sdh2hhgu339dhk7b.apps.googleusercontent.com",
"client_type": 3
}
]
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import android.widget.Button;
import android.widget.EditText;

import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;

public class MainActivity extends AppCompatActivity {

EditText loginC;
Expand All @@ -18,6 +21,13 @@ public class MainActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

DatabaseReference hyojin= FirebaseDatabase.getInstance().getReference("mainLogin/user");
user first=new user("apt","효진",318);
hyojin.child(first.getId()).setValue( first);
// hyojin.child(first.getId()).child("name").setValue("윤채");
// hyojin.child(first.getId()).removeValue();

init();
addListener();
}
Expand Down
36 changes: 36 additions & 0 deletions app/src/main/java/com/example/tarah/apartmentmanager/user.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.example.tarah.apartmentmanager;

public class user {
String id;
String name;
int code;
public user(String id,String name,int code){
this.id=id;
this.name=name;
this.code=code;
}

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public int getCode() {
return code;
}

public void setCode(int code) {
this.code = code;
}
}
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
android:layout_marginBottom="10dp">
<LinearLayout
android:orientation="vertical"
android:background="#33ffee"
android:background="#bb0f0f8d"
android:layout_marginTop="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:4.0.0'


// NOTE: Do not place your application dependencies here; they belong
Expand Down

0 comments on commit d5483a8

Please sign in to comment.