Questions tagged [android-studio]

15688 questions
0

votes
0

answer
20

Views

(WebView) view.setOnTouchListener not triggered

I am having the html file in my asset folder. Now i am trying to access the content with onTouch event. The following is my code.I have added two images for the reference. view = (WebView) findViewById(R.id.webview); view.getSettings().setJavaScriptEnabled(true); view.setOnTouchListener(new View.OnT...
Gayu R
1

votes
2

answer
2k

Views

How to upload a WAV file using URLConnection

Curretly, I can upload .wav files by using this command in Terminal (MAC): curl -H 'X-Arg: AccessKey=3f55abc5-2830-027ce-e328-4e74df5a3f8f' --data-binary @audio.wav -H 'Content-Type: audio/wav' http://generic-15327.2-3-11.com/bbb.aaa.eval/abc I want to do the same from Android. So far I have impleme...
Josh
1

votes
2

answer
1.6k

Views

Android Studio error running app: Unable to obtain debug bridge

My antivirus seems to have deleted or removed my adb.exe file from my SDK folder. Permission errors is preventing me to update my platform tools or installing the SDK platform tools. "Stopping ADB server failed (code -1)" "unzip failed \adb.exe. (access is denied)". I have tried restarting my Andro...
Craig Gallagher
1

votes
2

answer
12k

Views

Android Studio XML layout design preview not available

I don't know what happened, but today when I opened Android Studio the "split-screen" of the editing layout (Preview -half screen XML and the other half was the device preview-) was missing. - No preview option - The "component tree" tab was added automatically, yesterday I did not have this
Zbarcea Christian
1

votes
2

answer
2.1k

Views

Null object reference on LayoutManager

I am getting this error when trying to set my layoutmanager for my recyclerview. I have created a layout manager and set my recyclerview to use it. For some reason the layoumanager is null. java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jcaseydev.popularmovies/com.jcaseydev....
Justin Casey
1

votes
2

answer
1.1k

Views

CardView Padding/Spacing Varies on Different API Level

I am testing my application on multiple devices and noticed that with the CardView, certain devices are rendering spacing in between each CardView. I am trying to isolate the problem, and it looks like API 23 does not include any spacing, whereas API < 23 renders some sort of padding/spacing. Note t...
tccpg288
0

votes
2

answer
26

Views

How to get context from MainActivity from anywhere and how to access it's functions?

I've just recently started going on about android developing not long after I've got stuck. I want to know how can I get MainActivity's context and it's functions globaly (if that's possible) The only method I've got to work is passing the context as an argument to another classes' constructor. thi...
Fhasdoif Hofasdoif
0

votes
0

answer
7

Views

copying database failed toast /RecyclerView: No adapter attached; skipping layout"

I'm trying to create a dictionary app but when I run the app it runs but I receive a "copy failed" toast and in the logs, I found this error " E/RecyclerView: No adapter attached; skipping layout". please find here below my code with a screenshot. I've placed the SQLite file in the assets folder. co...
1

votes
2

answer
1.2k

Views

SDK for Android Studio failed to install and I can't launch and virtual device

So, this is the message that came up after I was trying to download the system image of a device with Android API 27: To install: - Google Play Intel x86 Atom System Image (system-images;android- 27;google_apis_playstore;x86) Preparing "Install Google Play Intel x86 Atom System Image (revision:1)"....
Rawan _
0

votes
4

answer
13

Views

Caused by: java.lang.ClassCastException: android.app.Application cannot be cast to com.example.myapp.MainActivity

Getting an error in logcat when app is launched.Below is the logcat and java code, i have checked this problem in stackover flow but unable to find the solution. MainActivity.Java public class MainActivity extends AppCompatActivity { public boolean toasted = false; @Override protected void onCreate(...
mohammed nabil
0

votes
0

answer
2

Views

android studio ftp client don't connect

I'm going to create android app which would store file on a ftp server (written in c#). I wrote: try{ FTPClient client = new FTPClient(); actMsg = "created"; client.connect("192.xxx.x.xxx",5656); actMsg = "connected"; client.disconnect(); actMsg = "disconnected successfully"; }catch(Exception...
Szymek G
1

votes
2

answer
1.2k

Views

ERROR: Gradle sync failed: Could not get unknown property 'API_KEY' for DefaultConfig_Decorated

ERROR: Could not get unknown property 'API_KEY' for DefaultConfig_Decorated{name=main, dimension=null, minSdkVersion=null, targetSdkVersion=null, renderscriptTargetApi=null, renderscriptSupportModeEnabled=null, renderscriptSupportModeBlasEnabled=null, renderscriptNdkModeEnabled=null, versionCode=nul...
Apoorva Naganalli
1

votes
2

answer
727

Views

Android Studio is not detecting code changes on build/run(

Whenever I make a code change in the Android Studio (version 3.0.1) I need to clean before I build in order for that change to take effect. Making a change and hitting the green arrow build/run button looks like it builds but the new changes are not incorporated unless the project is cleaned beforeh...
Clark Battle
1

votes
1

answer
860

Views
1

votes
1

answer
78

Views

Android Studio XML file Ctrl + Alt + L

I use Ctrl + Alt + L format XML file in Android Studio, i want it like this style just like imgae 1 ,but it's always like image 2, how can i do?
VenRen
1

votes
1

answer
856

Views

ANDROID STUDIO Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'

I'm new to Android studio and I have been facing this kind of error when I compile the android project that I bought from codecanyon. What am I missing"? Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'. Could not determine artifacts for io.realm:realm-android-librar...
kurt estacion
1

votes
1

answer
177

Views

AndroidJUnitRunner unit tests are very slow to execute

I'm using the AndroidJUnitRunner in my project, but the unit tests are painfully slow to execute on a device and emulator both in Android Studio and from the command-line via gradlew. I'm using the master branch of this open-source project, OneBusAway (as of this commit): https://github.com/OneBusAw...
Sean Barbeau
1

votes
1

answer
8

Views

error module not spcified in android studio

I have faced a problem when I run a project on android studio it says : Error: Module not specified
Sabbir
1

votes
2

answer
75

Views

Android Studio - Where is Kotlin installed?

I have macosx and I would like to use kotlin from terminal. Then I would like to find where is kotlin installed, since I'm using it from Android Studio. I know i can install Kotlin using homebrew but I want avoid having two copies of Kotlin.
Ricardo
1

votes
1

answer
618

Views

Android Stuido Gradle Sync failed - Could not get resource 'https:// … /gradle-3.2.0.pom'

i want to start android programming. after i install android studio 3.2 and create new project i get this exception: org.gradle.api.resources.ResourceException: Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.0/gradle-3.2.0.pom'. at org.gradle.inter...
Amir
1

votes
3

answer
633

Views

AndroidStudio - Program type already present: com.google.android.gms.location.places.zza

First : Let me explain the situation , i have an sdk works with google Api and implementing a lot of dependencies. then i implement the lib into my new app which is also implements dependencies. everything goes fine until i try to run the app. When i run (on device) my project I get the following er...
Mohamed Ali Nakouri
1

votes
2

answer
152

Views

GooglePlay - wrong signing key for app bundle

I've just now started using app bundles. I've set the two certificates in the App signing section of the dashboard (signing certificate and upload certificate). I've built an app bundle and signed it with the upload certificate, but when I upload the bundle under Android Instant Apps (which is in fa...
AndreiBogdan
1

votes
1

answer
45

Views

An error after adding a library to the Android project (More than one file was found with OS independent path 'META-INF/kotlinx-io.kotlin_module')

I've been playing with the "Hello World" project created in Android Studio 3.3 (New Empty Project) and decided to add a library (ktor) to the project. I followed the README instructions and simply added the required things to the gradle file. As I worked with the websockets, the following lines have...
ScienceSE
0

votes
0

answer
12

Views

Issue on displaying Tamil fonts in API 27,28

Here is my code: Typeface mtypeFace = Typeface.createFromAsset(getAssets(),"fonts/MyFont.ttf"); tvText.setTypeface(mtypeFace);
Sadeesh
0

votes
2

answer
17

Views

Strange language on Android Studio

My Android studio is rendering some strange character, can't seem to understand why. It was absolutely fine a couple of days back, and I don't remember making any changes. Tried restarting a couple of times, didn't help. Can somebody tell how to get back to original form? P.S I am running Windows 10
Aritra Das
0

votes
0

answer
19

Views

Run C code in android app (Android Studio)

I need to develop an Android application and use in it an algorithm that is written in C. I found a lot of tutorials for running ONE C function from a java activity. But what I need is: 1) reading a string in a java activity and "sending" it to C/C++ (this part works). 2) starting a little C algo (i...
elze
0

votes
2

answer
21

Views

How to retrieve title of action bar and assign it to text view?

How to retrieve title of Action bar and assign it to text view? I tried below code bit it not working... Please help. Code - t1 = rootView.findViewById(R.id.textview1); t1.setText(getActivity().getActionBar().getTitle().toString());
VikaS
0

votes
3

answer
24

Views

Android customlistview crashes after scrolling repeatedly

I made a listview with a custom layout but every time I scroll fast the app crashes with the following error in Logcat. I haven't really tried anything yet since I'm still not familiar with android. I have tried adding android:hardwareAccelerated="false" AND android:largeHeap="true" in to the Androi...
Autistic Nocc
1

votes
0

answer
8

Views

how to add drawable all images in array in android programmatically

I have a code that let me use images in drawable folder, but all the images are stored in array by name- I wanna load them programmatically by a function and store them in array this is the array : private int[] theBitmapIds = { R.drawable.elefant_001, R.drawable.elefant_002, R.drawable.elefant_00...
Amine Karim
0

votes
1

answer
19

Views

Android Studio IDE emulator opens, but project is not running/Compling

When I compiled my Android Studio IDE project, the emulator had opened, but project didn't run.I am using the latest version of Android IDE and I uninstalled Android IDE couple of times, and then again reinstalled it. Still, the problem persists. Please help me fixing this problem. When I run my An...
Zunayeed Kamal
0

votes
0

answer
6

Views

Return both result of array and single row in json data from php, mysql and show in android studio

I have created a recycler view with its adapter which returns the details in my sql database. I've implemented the search fuction which seems to work in my console. The problem is the php code which returns all the data in my db after I click on the search button. Is there anyway this can be solved?...
Mobile Induction
1

votes
2

answer
3.1k

Views

set max sdk version on build.gradle

How set the android max sdk version on build.gradle at android studio. I want do an app with two flavor, the first will run between version x~y and the second run at y+ Before on eclipse, in AndroidManifest.xml we have android:maxSdkVersion="y" but how it works on gradle?
ademar111190
0

votes
0

answer
10

Views

GridView nested inside RecyclerView not wrapping height and showing only single row

I tried wrapping content at various places in my code but that shows only single record inside gridview.In the image shown below there should be 4 rows but gridview is showing only one row. If i change height in row_work_report.xml to match_parent only then more records are visible. Please help as i...
Guneet Kaur
1

votes
4

answer
2.3k

Views

In Android Studio, cannot delete unnecessary folder

Say I want to remove the 'facebook' folder. When I right click on that folder, and go to refactor, the delete option is grayed out. But I want to delete it. I also tried selecting the folder and pressing delete on the keyboard. Still could not delete.
Bob
0

votes
0

answer
6

Views

how to support all screen sizes when using more than one spinner?

I am making a new app and I am a beginner so kindly help me with this, my layout is working great if I run without any java code for layout but when I use Java code, my layout is going beyond the screen I have tried to make different layout folders such as layout-sw320dp.... public class Main2Activi...
ashim
1

votes
1

answer
689

Views

Android Studio: How to see class hierarchy for gradle dependencies

I have included various dependencies in my build.gradle file. For example: dependencies { compile 'io.reactivex:rxandroid:1.0.1' } Is there any way to see the class hierarchy that this provides in Android Studio? e.g. the list of packages and classes. If I include a .jar dependency in my libs folder...
Ben Clayton
1

votes
2

answer
6.9k

Views

How to create class files in Android Studio

So I'm needing to create class files in Android Studio so I can use URLClassLoader. I need to do this so that I can pass custom objects through a socket, I keep getting a ClassNotFoundException. I know the conventional way to go about this is to add the object's class to the classpath, but I couldn'...
CaptainForge
1

votes
1

answer
535

Views

How to import openCV 3.1 in android studio 1.5.1 [closed]

I'm following these steps, but when I build it has an error:
Lovely ToonZ
0

votes
0

answer
6

Views

How can I finish activity after capture the screenshot of view?

I need to close the activity with screenshot of subview. Here is my code snippets for it. private void returnBackWithSavedImage() { int permissionCheck = PermissionChecker.checkCallingOrSelfPermission(this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE); if (permissionCheck == PackageManager.PE...
wagng

View additional questions

Смотреть фильмы онлайн бабушка легкого поведения 2 фильм бесплатно