Skip to content

Instantly share code, notes, and snippets.

View griajobag's full-sized avatar
🏠
Working from home

Putu Guna griajobag

🏠
Working from home
View GitHub Profile
private void startInsertDataDocumentGeneratedSendiri() {
progressDialog.show();
Map<String, Object> data = new HashMap<>();
data.put("nama", "putuguna");
data.put("website", "putuguna.com");
data.put("temaWeb", "Tentang Programming");
CollectionReference collectionReference = firebaseFirestore.collection("data");
collectionReference.add(data)
.addOnSuccessListener(new OnSuccessListener<DocumentReference>() {
private void startInsertDataDocumentManual() {
progressDialog.show();
for (int i = 0; i < 5; i++) {
Map<String, Object> data = new HashMap<>();
data.put("nama", "putuguna " + i);
data.put("website", "putuguna.com " + i);
data.put("temaWeb", "Tentang Programming " +i);
CollectionReference collectionReference = firebaseFirestore.collection("data");
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:id="@+id/btn_start_save_data"
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.putuguna.insertcolldoc"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
{
"data_diri" : {
"nama":"putuguna",
"website":"putuguna.com",
"pekerjaan":"Develope",
"Status":"ON"
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package rs;
import java.util.ArrayList;
import java.util.List;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package rs;
import java.util.List;
/**
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package rs;
import java.util.List;
/**
Class Pohon{
.....
}
Class Pinus extends Pohon {
.....
}