我使用Firebase的Spark(免费)计划.
(数据库同时连接,数据库存储等)的限制是基于项目还是基于用户.
例如,我有两个项目:
第一个项目有(一个Android应用程序和一个iOS应用程序),并有80个数据库同时连接.
第二个项目只有一个具有50个数据库同时连接的Android应用程序.
在这种情况下我是否超出限制(基于用户)或不是(基于项目)?
这是新的Android Q 范围存储的链接。
根据此Android开发者最佳实践博客,storing shared media files(这是我的情况)应使用MediaStore API完成。
深入研究文档,我找不到相关功能。
这是我在科特林的审判:
val bitmap = getImageBitmap() // I have a bitmap from a function or callback or whatever
val name = "example.png" // I have a name
val picturesDirectory = getExternalFilesDir(Environment.DIRECTORY_PICTURES)!!
// Make sure the directory "Android/data/com.mypackage.etc/files/Pictures" exists
if (!picturesDirectory.exists()) {
picturesDirectory.mkdirs()
}
try {
val out = FileOutputStream(File(picturesDirectory, name))
bitmap.compress(Bitmap.CompressFormat.PNG, 100, out)
out.flush()
out.close()
} catch(e: Exception) {
// handle the error
}
Run Code Online (Sandbox Code Playgroud)
结果是,Android/data/com.mypackage.etc/files/Pictures/example.png …
我错误地点击了一个键盘快捷键,使我的光标变成了一个矩形块而不是一条线,如图所示。
我试图撤消,但它撤消了代码。
每当我键入内容时,字符都会闪烁,然后字符会更改为我键入的内容,然后转到下一个字符。
isKeyPressed和isKeyJustPressed有什么区别?!
我搜索了文档.为了差异,刚刚发现:
isKeyPressed:返回是否按下了键.
isKeyJustPressed:返回是否刚刚按下了键.
有人知道更好的解释吗?!
我正在使用具有" 刷卡到刷新"布局的应用程序.
在"滑动到刷新"布局中向上滚动时,数据将从Internet刷新.(对于那些不知道的人)
我的数据源是Firebase.
在我的应用程序中,如果用户未连接,则显示网络错误消息,然后在打开互联网后,它不会获取数据.
你如何从我的数据库中再次获取数据.
这是代码:
protected void onCreate(Bundle savedInstanceState) {
...
mFirebaseDatabase = FirebaseDatabase.getInstance();
// my database
mNewsDatabaseReference = LoginActivity.mFirebaseDatabase.getReference()
.child("data").child("news");
// my database reference
// my ChildEventListener
mNewsChildEventListener = new ChildEventListener() {
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String s) {
// my data
News news = dataSnapshot.getValue(News.class);
// add the news to the top of my ArrayAdapter
myAdapter.insert(news, 0);
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String s) {}
@Override
public void onChildRemoved(DataSnapshot dataSnapshot) {}
@Override
public …Run Code Online (Sandbox Code Playgroud) java android firebase swiperefreshlayout firebase-realtime-database
但两者都给出了解决方案,例如更改海拔或平移。
问题是关于在不支持海拔或平移属性的旧版本中将进度栏放在按钮前面。
我怎样才能在 XML 和 Java 中做到这一点?
或者它是无效的。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.business.abdelhafiz.omar.civiltaif.LoginActivity">
<ImageView
android:src="@drawable/home_civil"
android:scaleType="fitXY"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ProgressBar
android:id="@+id/login_progressbar"
android:layout_centerInParent="true"
android:layout_width="@dimen/image_height"
android:layout_height="@dimen/image_height" />
<Button
android:id="@+id/login_email"
android:layout_centerInParent="true"
android:text="@string/login_email"
android:onClick="loginEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:id="@+id/login_anonymous"
android:layout_centerInParent="true"
android:layout_below="@id/login_email"
android:text="@string/login_anonymous"
android:onClick="loginAnonymous"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
这是一个屏幕截图
我想将进度条放在按钮前面
编辑:
没有什么对我有用,所以当我需要显示进度栏时,我只会隐藏按钮。
感谢您的帮助。