Android Studio questions & answers

Create custom applications for Android devices
N
Question by Nimai
99 views
August 28, 2020
A
Answer by Akash Shah

Yes, you can download Android Studio 2.2 from the mentioned site.

G
Question by Guest
103 views
June 2, 2020
Pooja Bajaj
Answer by Pooja Bajaj

Yes, Android Studio 3.0.1 can work on a 2 GB RAM and 64-bit operating system.

G
Question by Guest
221 views
March 30, 2018

Hello,


I created two XML activities. One is for the activity interface layout and another one is the for the coordinator layout. I added the include layout for the interface layout activity into the coordinator layout and I can't see my interface layout from the preview. The preview is blank and these are the errors they are showing me:


*************************************************
Error 1: RENDER PROBLEMS
tag requires a 'drawable' attribute or child tag defining a drawable
_______________________________________________________________________________
Error 2: can't make a decor toolbar out of relative layout
java.lang.IllegalStateException: Can't make a decor toolbar out of RelativeLayout
at android.support.v7.widget.ActionBarOverlayLayout.getDecorToolbar(ActionBarOverlayLayout.java:549)
at android.support.v7.widget.ActionBarOverlayLayout.pullChildren(ActionBarOverlayLayout.java:538)
at android.support.v7.widget.ActionBarOverlayLayout.onMeasure_Original(ActionBarOverlayLayout.java:339)
at android.support.v7.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java)
at android.view.View.measure_Original(View.java:22071)
at android.view.View_Delegate.measure(View_Delegate.java:80)
at android.view.View.measure(View.java:22035)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
at android.view.View.measure_Original(View.java:22071)
at android.view.View_Delegate.measure(View_Delegate.java:80)
at android.view.View.measure(View.java:22035)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.measureView(RenderSessionImpl.java:590)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:343)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:384)
at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:193)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:544)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$3(RenderTask.java:678)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
R
Answer by Robert Polubinski

You will have to check the available websites listed on the Google Search to find out about the way you implement the layout in the coordinator layout.


Luckily, there are plenty websites and videos that can teach you how to work with the Android Studio. I highly recommend checking the websites listed on the following page.

P
Question by Prathmesh Shinde
3K views
December 19, 2017

I am working on one project while building gradle it shows gradle sync failed and I am receiving "Error: Unexpected lock protocol found in lock file. Expected 3,found 0." Now I want to know how to solve this error.

S
Answer by Sean Hill

It's actually very simple to overcome this issue. Navigate to the project folder and delete the following one .gradle. Restart the IDE and it should work properly afterwards.


Or in the IDE go to File -> Project Structure then Select Project and locate the gradle version. Navigate to C:\Users\YOURUSERNAME\.gradle\caches and delete the version you've identified.

D
Question by Dejene Techane
660 views
April 26, 2017

I installed Android Studio 2.3.1 on Linux 32bit machine (Kali Linux). It is successfully installed. When I tried to create an application, the following errors appeared:


When I start to run an application on the external device, it will generate the following error


Error message: Unable to detect adb version, adb output: /home/elsi/Android/Sdk/platform-tools/adb: 1: /home/elsi/Android/Sdk/platform-tools/adb: Syntax error: ")" unexpected


I tried the following solution on the terminal


elsi@kali-Rolling:~/Android/Sdk/platform-tools$ adb kill-server
elsi@kali-Rolling:~/Android/Sdk/platform-tools$ adb start-server

  • daemon not running. starting it now on port 5037 *
  • daemon started successfully *
    elsi@kali-Rolling:~/Android/Sdk/platform-tools$ adb devices
    List of devices attached
    793532E2034CF208 device

These are the current versions of Android SDK and Gradle version installed:
compileSdk version 25, buildTools version 25.0.3.


Still, the problem is not fixed. When I created a virtual device (emulator) to run the program, it also generates an error saying HAXM requires a genuine Intel processor. I tried to search for some solutions on the Internet, but Kali Linux does not support this processor, therefore, I installed KVM, and other required packages are not supported as well.


Please, I need a serious solution for the above problems.

R
Answer by Robert Polubinski

Access the Android Studio's installation folder and remove the contents of the platform-tools. Then download the archive below and copy all the contents to the platform-tools folder.

This is an issue with the 32 and 64bit architecture mode. It should work after you replace the files. As for the virtual machine, make sure that when you create one to download the requirements and no error appears during the installation.

G
Question by Guest
313 views
March 30, 2018

I created two XML activities. One is for the activity interface layout and another one is the for the coordinator layout. I added the included layout for the interface layout activity into the coordinator layout and I can't see my interface layout from the preview. The preview is blank and these are the errors it's showing me:


Error 1: RENDER PROBLEMS
tag requires a 'drawable' attribute or child tag defining a drawable
___________________________________________________________________________
Error 2: can't make a decor toolbar out of relative layout
java.lang.IllegalStateException: Can't make a decor toolbar out of RelativeLayout
at android.support.v7.widget.ActionBarOverlayLayout.getDecorToolbar(ActionBarOverlayLayout.java:549)
at android.support.v7.widget.ActionBarOverlayLayout.pullChildren(ActionBarOverlayLayout.java:538)
at android.support.v7.widget.ActionBarOverlayLayout.onMeasure_Original(ActionBarOverlayLayout.java:339)
at android.support.v7.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java)
at android.view.View.measure_Original(View.java:22071)
at android.view.View_Delegate.measure(View_Delegate.java:80)
at android.view.View.measure(View.java:22035)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
at android.view.View.measure_Original(View.java:22071)
at android.view.View_Delegate.measure(View_Delegate.java:80)
at android.view.View.measure(View.java:22035)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.measureView(RenderSessionImpl.java:590)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:343)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:384)
at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:193)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:544)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$3(RenderTask.java:678)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
S
Answer by Sean Hill

The Mastering Coordinator Layout lessons provided on the GitHub explains exactly what needs to be done in order to make it work. I recommend checking the following URL to access the lessons.


Also, the developers of Android Studio have set up a page with the exact instructions and information on how to proceed with the development part.

J
Question by Joeri Dukker
296 views
December 3, 2017

I am making a math quiz where a mathematical question will be asked in the form of a formula. I put my questions in an ArrayList:


ArrayList> quizArray = new ArrayList<>();
String quizData[][] = {
{"x^2", "1", "0", "x", "-1"},
{"x^2", "5", "x", "5x-2", "1"},
{"0", "0", "x", "e", "-1"},
{"x+1", "5", "x", "5x-2", "1"},
{"3", "1", "0", "x", "-1"},
{"642", "34", "97", "5x-2", "1"}
};

As you can see I tried to make the formula x^2, this will not be shown as x with a small exponent 2 but as x^2. This x^2 is not what I want. How can I used for example html in this arraylist to achieve this goal? Or is there another way?

S
Answer by Sean Hill

There are many ways you can display math formulas in Android Studio and practically in any application that you develop. There are modules that parse your input and display the formula exactly as they have to be.


For example, you can use MathView and its source code to display the formula correctly in Android Studio.

M
Question by Madhav
287 views
March 11, 2018
S
Answer by Sean Hill

The Constraint layout module needs to be installed in your Android Studio. To check if it's installed, go to Preferences > Appearance & Behavior > System Settings > Android and then SDK Tools. Check the Constraint Layout and install it.


Perform a deep restart of everything and then the error shouldn't be there anymore. This is a basic fix to the errors regarding the Constraint Layout.

G
Question by Guest
272 views
September 6, 2016

I have published an app via the developer console, would like to import this app in Studio. How can I do this?

S
Answer by Sean Hill

Theoretically, you will have to create a new project, then paste the folder with your app into the project folder and modify the settings file.


I believe you need to edit the settings.gradle file and add the project name like:


include ':appname', ':helloworldapp'

then modify the build.gradle to include dependencies:


dependencies {
compile project(':appname')
compile 'com.android.support:appcompat-v7:+'
}

Note: Modify it based on your app name, compatibility support, libraries, etc.


Additionally, use the User Guide available online to learn how to work with Android Studio: https://developer.android.com/studio/intro/index.html

Smarttech
Question by Smarttech
258 views
April 18, 2014

I have Android Studio installed on my notebook. However, it isn't running like it should. My notebook runs Windows 8 on 32-bit. Is there a way to overcome this?

L
Answer by Leonard Moore

This is a development tool for Android devices. It seems that there is only one version of the product that can be run on Windows platforms. If you encounter any difficulties in running the application, try to update the program's version to the latest one available. This is advised because newer versions have implemented fixes for some known errors.

See more questions & answers

Ask a question about Android Studio

Alternative downloads

Aptana Studio
Free
rating

It allows you to develop and test your entire web application.

b4a
Free
rating

Create any type of Android app using B4X programming language.