Categories
CMS Mastering Development Wordpress

Create Media via REST API from Android Application

I am not sure if this post will be considered as duplicate since the same is on stackoverflow.com. I am trying to upload a file to WordPress using REST API. I have tried different headers, values but no luck. I have tried different clients such as okhttp and custom one such as Fast-AndroidNetworking. I have […]

Categories
Development

How to update image from firebase storage and update image reference link from firestore database in android

I have searched many website over internet but I didn’t found any proper guidelines about how i would update image form firebase cloud storage and update image reference from firestore database. I have uploaded an image into firebase storage and create image link reference into firebase firestore database in the following way: @Override protected void […]

Categories
Development

NPE whenever I want to run Intent from my class

I’m a beginner when it comes to Android app development. I have finished some Udemy courses, but then I realized that the Android Docs might actually be better for building a good foundation on app development. I’m trying to build my own app now but I encountered this problem. My Class public class deleteInfluencer extends […]

Categories
Development

How to get the image name when user upload the image from gallery and display them in textView?

I’m trying to retrieve the actual image name of the image selected by user in gallery(Ex. IMG_2020). I tried using getAbsolutePath() and getName() but these 2 methods display something like “image$3A75” instead of the actual image file name. Other than that, I also tried using some cursor method which I don’t know really how it […]

Categories
Development

A blank space appears where a picture should be displayed

So from part of a project I am making, a chat app, I am adding the ability for users to change their profile picture. I am using Firebase for the storage. The thing here is that the image is uploaded successfully, and stored in the Firebase, but in the app a blank space is displayed, […]

Categories
Development

How do I retrieve the file size of an image selected from my gallery?

I’ve tried the answers on every other post out there and they all seem to return 0.0 as the file size of my image which cannot be true. I think the file path is what’s causing it to return the incorrect file size. Here is my code: @Override protected void onActivityResult(int requestCode, int resultCode, @Nullable […]

Categories
Development

How do I use the variable distanceHala outside of this public void?

So what I want is to calculate the distance between the users current location and a marker on the map. final LocationRequest locationRequest = LocationRequest.create(); locationRequest.setInterval(2000); locationRequest.setFastestInterval(1000); locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); locationCallback = new LocationCallback() { @Override public void onLocationResult(LocationResult locationResult) { super.onLocationResult(locationResult); if (locationResult == null) { return; } mLastKnownLocation = locationResult.getLastLocation(); LatLng lastKnownLatLng = new LatLng(mLastKnownLocation.getLatitude(), […]

Categories
Development

Error when trying to get user information using people API from googleAccount?

I’m trying to get the user account information from google like birthdate , gender and other user data but i get this exception while using people API W/System.err: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden { “code” : 403, “errors” : [ { “domain” : “global”, “message” : “The request is missing a valid API key.”, “reason” : “forbidden” […]

Categories
Development

ServerValue.TIMESTAMP best way to

I’m having difficulties with the timestamp. I saw some posts that indicated that the best practice to save TIMESTAMP in the database was to do it as ServerValue.TIMESTAMP which is what I did as you can see below, and it’s showing up in my Logcat, but not in the app where I am trying to […]

Categories
Android Development

How can i get the name of an image that i take out of the gallery in Android Studio?

I have an app where i take out images of the galery and i want to get the name of the image because i am going to use it to do a deteccion of color with OpenCV. I am using this code to get the images of the galery. public void Click(View view) { cargarImagen(); […]