GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — AndroidTutorialForBeginners/Firebase.txt at master · FiresideCode/AndroidTutorialForBeginners

Expand file tree

/

Firebase.txt

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
103 lines (73 loc) · 3.36 KB
/

Firebase.txt

Copy path

File metadata and controls

103 lines (73 loc) · 3.36 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// Realtime Database
private DatabaseReference mDatabase ;
mDatabase = FirebaseDatabase.getInstance().getReference();
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
Date date = new Date();
mDatabase.child("UsersUpdates").child(GlobalClass.UserUID).child("UpdateOrder").setValue(dateFormat.format(date).toString());
//check if there is update in order node
mDatabase.child("UsersUpdates").child("UpdateOrder").addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
}
@Override
public void onCancelled(DatabaseError error) {
// Failed to read value
// Log.w(TAG, "Failed to read value.", error.toException());
}
});
//Remote config
add Xml file name "price_tool"
<?xml version="1.0" encoding="utf-8"?>
<defaultsMap>
<enty>
<key>price</key>
<value>50 dolor</value>
</enty>
</defaultsMap>
Code ro run
final FirebaseRemoteConfig mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
mFirebaseRemoteConfig.setDefaults(R.xml.price_tool);
long exp=0;
mFirebaseRemoteConfig.fetch(exp).addOnCompleteListener(new OnCompleteListener<Void>() {
@Override
public void onComplete(@NonNull Task<Void> task) {
if (task.isSuccessful()) {
String price = mFirebaseRemoteConfig.getString("price");
Toast.makeText(getApplicationContext(), price, Toast.LENGTH_LONG).show();
mFirebaseRemoteConfig.activateFetched();
}
}
});
try{
int x=10/0;
}catch (Exception ex){
FirebaseCrash.report(new Exception("bugs in "+ ex.getMessage()));
}
//Storage- upload images
imageView=(ImageView)findViewById(R.id.imageView);
FirebaseStorage storage=FirebaseStorage.getInstance();
// Create a storage reference from our app
StorageReference storageRef = storage.getReferenceFromUrl("gs://firbasedemo-6228f.appspot.com");
// Create a reference to "mountains.jpg"
StorageReference mountainsRef = storageRef.child("images/mountains.jpg");
imageView.setDrawingCacheEnabled(true);
imageView.buildDrawingCache();
// Bitmap bitmap = imageView.getDrawingCache();
BitmapDrawable drawable=(BitmapDrawable)imageView.getDrawable();
Bitmap bitmap =drawable.getBitmap();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos);
byte[] data = baos.toByteArray();
UploadTask uploadTask = mountainsRef.putBytes(data);
uploadTask.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
// Handle unsuccessful uploads
}
}).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
// taskSnapshot.getMetadata() contains file metadata such as size, content-type, and download URL.
Uri downloadUrl = taskSnapshot.getDownloadUrl();
}
});
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.