android-studio

Is there any way to get the endpoints of a line when using Path class?

放肆的年华 提交于 2021-02-11 13:00:53
问题 I am building an app where a user can draw lines in a custom canvas with a finger (multiple fragments have a canvas and this works) using the Path class. I also managed to use SharedPreferences to save and load the drawn lines but when loaded the lines start from the top left (i.e (0, 0)) and the shape has changed to lines with a slight curve at the start (I say start because I found that the line ends from where the touch started). The start points are kept in Path but from what I can see

How to fix this margin gap?

谁都会走 提交于 2021-02-11 12:51:45
问题 I am creating an Faq page using TextViews, So the textviews become visible and hide automatically when clicked, but this was overlapping the upcoming question so I researched and found marginlayoutparams solution but this code won't reset back when clicked again. Initial state: After I click Fare Charges: After I click on it again: The code: import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.MotionEvent; import android.view.View; import android.view

How to fix this margin gap?

雨燕双飞 提交于 2021-02-11 12:51:07
问题 I am creating an Faq page using TextViews, So the textviews become visible and hide automatically when clicked, but this was overlapping the upcoming question so I researched and found marginlayoutparams solution but this code won't reset back when clicked again. Initial state: After I click Fare Charges: After I click on it again: The code: import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.MotionEvent; import android.view.View; import android.view

unable to create new flutter project on android studio getting error => Could not find a file named “pubspec.yaml” at project location drive

帅比萌擦擦* 提交于 2021-02-11 12:26:39
问题 I installed flutter by following flutter documentation. This is the error I'm getting=> Could not find a file named "pubspec.yaml" in "E:". pub get failed (66; Could not find a file named "pubspec.yaml" in "E:". when I checked my project directory(E:\Fapplication) there was an empty folder with the project name(flutter_appp) but the android studio also created the same folder(flutter_appp) directly in the project location's drive(E:) with all contents of the project. flutter doctor -v checked

unable to create new flutter project on android studio getting error => Could not find a file named “pubspec.yaml” at project location drive

北城余情 提交于 2021-02-11 12:26:38
问题 I installed flutter by following flutter documentation. This is the error I'm getting=> Could not find a file named "pubspec.yaml" in "E:". pub get failed (66; Could not find a file named "pubspec.yaml" in "E:". when I checked my project directory(E:\Fapplication) there was an empty folder with the project name(flutter_appp) but the android studio also created the same folder(flutter_appp) directly in the project location's drive(E:) with all contents of the project. flutter doctor -v checked

How to save a token secretly in Android

纵然是瞬间 提交于 2021-02-11 12:26:07
问题 I have an Android app where users have to login to use it, when a request is made (in PHP) a token is needed, the thing is, I need to save the token in Android's shared preferences, I know there are ways to encrypt it, but if someone would go to open the app and see the source code, the would know how it was encrypted. How do I securely save the token? Thanks in advance. 回答1: Android Keystore is a preferred way of storing sensitive information, namely token, password, etc. However, in case

How to save a token secretly in Android

寵の児 提交于 2021-02-11 12:25:10
问题 I have an Android app where users have to login to use it, when a request is made (in PHP) a token is needed, the thing is, I need to save the token in Android's shared preferences, I know there are ways to encrypt it, but if someone would go to open the app and see the source code, the would know how it was encrypted. How do I securely save the token? Thanks in advance. 回答1: Android Keystore is a preferred way of storing sensitive information, namely token, password, etc. However, in case

Why does the Android SDK 30 generate invalid APK files?

血红的双手。 提交于 2021-02-11 12:23:59
问题 I built a new Java Android app on a new PC using a fresh install of Android Studio 4.1.2, and was able to run it on my phone from the debugger fine. However, when I built a signed APK file (using my normal key store file) and copied it to my phone, I could not install it on the phone using the Google Files app, like I usually can. After several hours, I eventually worked out that if I changed my build.gradle file so that the compileSdkVersion, buildToolsVersion, and targetSdkVersion were all

Why can't I upload a picture from gallery in my android app, if the picture was taken with the camera app from android?

浪尽此生 提交于 2021-02-11 12:22:27
问题 I want to upload an image from gallery and show it on my Android app. This works fine if I select an image from the screenshot folder for example. But when I select an image from the folder where the pics, taken with the phone camera, are stored, it does not work. public void UploadPicture(View v) { Intent pickPhoto = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(pickPhoto , 1); protected void onActivityResult(int

Why can't I upload a picture from gallery in my android app, if the picture was taken with the camera app from android?

前提是你 提交于 2021-02-11 12:21:14
问题 I want to upload an image from gallery and show it on my Android app. This works fine if I select an image from the screenshot folder for example. But when I select an image from the folder where the pics, taken with the phone camera, are stored, it does not work. public void UploadPicture(View v) { Intent pickPhoto = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(pickPhoto , 1); protected void onActivityResult(int