android-studio

How to encrypt sqlite texts without 3rd party libraries (Android)

谁说我不能喝 提交于 2021-02-11 18:09:49
问题 I'm using an external database inside my android application and it directly embeds inside the apk package after compiling. As I want to implement in app purchase in order to access some of its data I don't want to leave it without any encryption. I used Sqlcipher library but it makes the app too big and slow. Isn't there any other way to do this? For example an algorithm to encrypt the strings so I put the encrypted text in database and decrypt it inside application code? 回答1: The following

error: cannot find symbol class Android Studio

随声附和 提交于 2021-02-11 17:42:37
问题 This error hapens after update mac osx or system (I don't know). It was after I open project that I closed one weak ago. My settings.gradles is: include ':app' , ':api', ':daogenerator' project(':mobilneapi').projectDir = new File("/Users/AndroidstudioProjects/Modules/api") project(':daogenerator').projectDir = new File("/Users/AndroidstudioProjects/Modules/daogenerator") And my app gradle: apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.1"

Attempt to invoke virtual method 'android.content.Context.getApplicationInfo()' on a null object reference in Android Studio

梦想与她 提交于 2021-02-11 16:20:21
问题 I had the Attempt to invoke virtual method 'java.util.List com.example.demo.Database.Database.getName()' on a null object reference error in my application and I solved that error using Database database = new Database(this); code. Now there is a new error E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.demo, PID: 19678 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.demo/com.example.demo.MainActivity}: java.lang.NullPointerException: Attempt

Attempt to invoke virtual method 'android.content.Context.getApplicationInfo()' on a null object reference in Android Studio

蹲街弑〆低调 提交于 2021-02-11 16:18:35
问题 I had the Attempt to invoke virtual method 'java.util.List com.example.demo.Database.Database.getName()' on a null object reference error in my application and I solved that error using Database database = new Database(this); code. Now there is a new error E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.demo, PID: 19678 java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.demo/com.example.demo.MainActivity}: java.lang.NullPointerException: Attempt

Change height percentage based on another view's height in ConstraintLayout

隐身守侯 提交于 2021-02-11 16:14:20
问题 I have a view defined as <View android:id="@+id/guideLayout" android:visibility="invisible" app:layout_constraintBottom_toTopOf="@+id/signupBtn" app:layout_constraintTop_toBottomOf="@+id/balanceText" android:layout_width="0dp" android:layout_height="0dp"/> The view basically extends itself above a signupBtn and below a balanceText I want to add a new textView whose height is equal to a percentage of its view. Currently I am doing this <TextView android:layout_marginTop="21dp" app:layout

Change height percentage based on another view's height in ConstraintLayout

痴心易碎 提交于 2021-02-11 16:12:42
问题 I have a view defined as <View android:id="@+id/guideLayout" android:visibility="invisible" app:layout_constraintBottom_toTopOf="@+id/signupBtn" app:layout_constraintTop_toBottomOf="@+id/balanceText" android:layout_width="0dp" android:layout_height="0dp"/> The view basically extends itself above a signupBtn and below a balanceText I want to add a new textView whose height is equal to a percentage of its view. Currently I am doing this <TextView android:layout_marginTop="21dp" app:layout

Resources$NotFoundException: Drawable com.example.test:drawable/back_button with resource ID #0x7f080073

▼魔方 西西 提交于 2021-02-11 15:20:49
问题 I recently added vector drawables (anydpi) to my android studio project in addition to png images (mdpi, hdpi, xhdpi, and xxhdpi)--android studio does this by default now. I immediately started getting this error: 2019-02-10 23:10:25.870 2722-2722/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.test, PID: 2722 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test/com.example.test.SettingsActivity}: android.content.res.Resources$NotFoundException:

Can't pick image from gallery

丶灬走出姿态 提交于 2021-02-11 15:08:06
问题 I am coding an application for recognizing plant species. I want to pick an image and show that on screen but i can't. Image returns null. Although i choose photo from gallery, it still says "no image selected". I also added read_external_storage permission to android manifests. import 'dart:io'; import 'package:tflite/tflite.dart'; import 'package:flutter/material.dart'; import 'package:image_picker/image_picker.dart'; class PlantSpeciesRecognition extends StatefulWidget { var model;

Have second okHTTP request wait for the first to finish Android

蹲街弑〆低调 提交于 2021-02-11 14:47:55
问题 I am trying to call and IMDb API 2 times, the first time it calls and gets the ID for that movie/show and the second time it uses that ID to get all the information about that movie/show, I also need that ID for another part of the app so that is why I am doing it this way. The problem is that the second call isn't waiting for the first call to be done. I think this is why the variables aren't updated when I am trying to use them. This is my onCreate method where all this is happening, I took

How to move a view (button) programmatically in a constraint layout?

徘徊边缘 提交于 2021-02-11 14:26:39
问题 I'm trying to create a simple timetable, (I'm a beginner). I have created a basic layout for the timetable with 7 days and 24 hours, and my idea was to insert buttons programmatically, overlaying the timetable for the correct time and duration by manipulating the position and width of the buttons, so that when clicked they display the task saved in the textview below as such: I know how to create the buttons but after hours of searching for a working method to change their size and location