我想让用户在他们的位置放置一个标记,然后拍照。 然后将图片上传到他们的坐标和firebase Uid下。 这里是我当前的代码:Android-如何将图片从Google地图上传到Firebase?
final LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
ivcam.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, CAMERA_REQUEST);
String userUid = FirebaseAuth.getInstance().getCurrentUser().getUid();
StorageReference storageRef= FirebaseStorage.getInstance().getReference();
StorageReference mountainsRef = storageRef.child("uploads/")
.child(String.valueOf(latLng))
.child(userUid)
.child(String.valueOf(System.currentTimeMillis()));
final MarkerOptions markerOptions = new MarkerOptions();
markerOptions.position(latLng);
markerOptions.title(String.valueOf(latLng));
markerOptions.draggable(false);
markerOptions.icon(BitmapDescriptorFactory.fromResource(R.drawable.marker3));
mCurrLocationMarker = mMap.addMarker(markerOptions);
}
});
有没有任何错误,但是当我拍照,没事就火力地堡储存显示出来。谢谢您的帮助。
显示你在哪里上传图像 –
代码是否那里没有上传图片的代码?对不起,新的android – Mozy
检查我的答案,下面希望它有助于:) –