android

Firebase realtime database validation username and email

北慕城南 提交于 2021-02-15 07:40:21
问题 Recently found out the database rules can be set to validate whether the database already have the same data but currently it just accepted same data to insert but how to validate and prevent same input of username and email? { "rules": { ".read": true, ".write": true, "username":{ ".validate": "!root.child('username').child(newData.val()).exists()" }, "email":{ ".validate": "!root.child('email').child(newData.val()).exists()" } } } The root child is created by email authentication uid and

Firebase realtime database validation username and email

ε祈祈猫儿з 提交于 2021-02-15 07:40:20
问题 Recently found out the database rules can be set to validate whether the database already have the same data but currently it just accepted same data to insert but how to validate and prevent same input of username and email? { "rules": { ".read": true, ".write": true, "username":{ ".validate": "!root.child('username').child(newData.val()).exists()" }, "email":{ ".validate": "!root.child('email').child(newData.val()).exists()" } } } The root child is created by email authentication uid and

Show video, gif or banner in push notificaion

∥☆過路亽.° 提交于 2021-02-15 07:35:45
问题 I have come across the notification which actively changes the content like banners. AFAIK videos and GIFs are not supported in the notification. How can we achieve this? I have searched and found Custom Notification Layout might the solution. But not quite sure. 来源: https://stackoverflow.com/questions/65773220/show-video-gif-or-banner-in-push-notificaion

I want to delete the array stored in Firestore

非 Y 不嫁゛ 提交于 2021-02-15 07:34:22
问题 I received the user's email and designated it as the name of the document, and stored the user information in the document in an array. I tried running my code, but only the Toast message is executed, not deleted. I have listed the arrays as a list using RecyclerView . Deletion will be implemented through showPop() method. This is my Firestore database enter image description here I want to delete index-0 private void showPopup(View v,final int position) { PopupMenu popup = new PopupMenu

Android how can i replace the deprecated tabhost?

青春壹個敷衍的年華 提交于 2021-02-15 06:52:32
问题 I'm going to create an application which is designed to use Tabhost , but as I know it's been deprecated. So my question is should I use Tabhost anyway or how can I replace it..by using buttons instead of them declared in every xml or any other suggestions? 回答1: "Deprecated" in Android means "we think there is a better solution that you should investigate". Rarely does "deprecated" mean "it is unusable". TabHost , AFAIK, works fine on Android 4.0. That being said, I would recommend

android -------- java虚拟机和Dalvik虚拟机

牧云@^-^@ 提交于 2021-02-15 06:28:19
java虚拟机 虚拟机是一种抽象化的计算机,通过在实际的计算机上仿真模拟各种计算机功能来实现的。Java虚拟机有自己完善的硬体架构,如处理器、堆栈、寄存器等,还具有相应的指令系统。Java虚拟机屏蔽了与具体操作系统平台相关的信息,使得Java程序只需生成在Java虚拟机上运行的目标代码(字节码),就可以在多种平台上不加修改地运行。 Java虚拟机(Java Virtual Machine 简称JVM)是运行所有Java程序的抽象计算机,是Java语言的运行环境,它是Java 最具吸引力的特性之一。 Dalvik虚拟机 Dalvik是Google公司自己设计用于Android平台的虚拟机。Dalvik虚拟机是Google等厂商合作开发的Android移动设备平台的核心组成部分之一。它可以支持已转换为 .dex(即Dalvik Executable)格式的Java应用程序的运行,.dex格式是专为Dalvik设计的一种压缩格式,适合内存和处理器速度有限的系统。Dalvik 经过优化,允许在有限的内存中同时运行多个虚拟机的实例,并且 每一个Dalvik 应用作为一个独立的Linux 进程执行。独立的进程可以防止在虚拟机崩溃的时候所有程序都被关闭。 DVM虚拟机Dalvik Virtual Machine,是安卓中使用的虚拟机。全部安卓程序都运行在安卓系统进程里

Is it possible to set Material ChipGroup orientation to VERTICAL?

試著忘記壹切 提交于 2021-02-15 06:19:58
问题 I'm adding a material ChipGroup dynamically to a parent linear layout which is set to VERTICAL orientation but the chip items seem to be added horizontally. Is there any way to make it lay out the chip items vertically? setLayoutDirection() method of ChipGroup class method doesn't seem to take any parameter that supports VERTICAL orientation. 回答1: you can set width = match_parent in each Chip item <com.google.android.material.chip.ChipGroup android:id="@+id/chipGroup" android:layout_width=

Is it possible to set Material ChipGroup orientation to VERTICAL?

六眼飞鱼酱① 提交于 2021-02-15 06:14:47
问题 I'm adding a material ChipGroup dynamically to a parent linear layout which is set to VERTICAL orientation but the chip items seem to be added horizontally. Is there any way to make it lay out the chip items vertically? setLayoutDirection() method of ChipGroup class method doesn't seem to take any parameter that supports VERTICAL orientation. 回答1: you can set width = match_parent in each Chip item <com.google.android.material.chip.ChipGroup android:id="@+id/chipGroup" android:layout_width=

Android Convert current screen to bitmap

一笑奈何 提交于 2021-02-15 06:01:15
问题 I would like to convert a screen of my app and convert it into a Bitmap. I already know how to convert a view into a bitmap, but that's not what I want as my screen is made up of many fragments. Thus I'd like to be able to take the screen and convert it into a bitmap... Help is highly appreciated thanks. 回答1: You could use something like this and pass the layout as a view ;) public Bitmap takeScreenShot(View view) { // configuramos para que la view almacene la cache en una imagen view

Getting error “You have exceeded the maximum transaction amount set by your bank” when calling Google Pay intent from my android app

泪湿孤枕 提交于 2021-02-15 05:40:38
问题 I am facing a problem with Google pay integration(in-app payment) in android app. When I make a request to transact I am getting the error "You have exceeded the maximum transaction amount set by your bank" even though that is my first transaction. And when I try to send amount directly from Google pay it works. This is the Google pay's in-app payment resource. Here is code Uri uri = new Uri.Builder() .scheme("upi") .authority("pay") .appendQueryParameter("pa", upiId) //receiver's upiId