FAQ Database Discussion Community


Where to put Gradle 2.2.1 manually

android,android-studio,android-gradle
I am working on an android app on android studio, my app is trying to fetch a zip from this url http://services.gradle.org/distributions/gradle-2.2.1-all.zip but to some unknown reasons it is not able to fetch it, now my question is if I download this zip manually where should I put it to...

Action Bar No Resource Found.

android,android-studio,android-actionbar
I was trying to run the following code from the android studio guide: <menu xmlns:android="http://schemas.android.com/apk/res/android" > <!-- Search, should appear as action button --> <item android:id="@+id/action_search" android:icon="@drawable/ic_action_search" android:title="@string/action_search" android:showAsAction="ifRoom" /> <!-- Settings, should always be in the overflow --> <item android:id="@+id/action_settings" android:title="@string/action_settings" android:showAsAction="never" /> However, for the...

Android MediaPlayer playing sound ok on virtual device and on tablet, but intermittently on smartphone galaxy s iii mini

android,android-activity,android-studio,android-mediaplayer,samsung-mobile
I'm using the following code in onCreate() mPlayer = MediaPlayer.create(this, R.raw.rain); mPlayer.start(); No problems in virtual emulator nor in tablet galaxy tab, but when I try on my Galaxy S 3 mini it plays the sound intermittently, my logcat looks like this: 06-11 12:48:04.253 5579-5579/? D/dalvikvm﹕ Late-enabling CheckJNI 06-11 12:48:04.573...

Gradle - Error:Failed to find: com.squareup.okhttp:okhttp:2.4.0

android,android-studio,gradle,okhttp
I just try to use OkHttp but I have the following issue when I sync my gradle file with Android Studio : Error:Failed to find: com.squareup.okhttp:okhttp:2.4.0 Here is the dependencies part of my build.gradle file : dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:appcompat-v7:22.1.1' compile 'com.google.android.gms:play-services-maps:6.5.87' compile 'com.squareup.okhttp:okhttp:2.4.0' }...

SugarORM + Kotlin: Unresovled reference “listAll”

android,android-studio,kotlin,sugarorm
I am trying to use the gorgeous Kotlin and SugarORM in combination for Android development and have my models set up like this: import com.orm.SugarRecord public class Contact : SugarRecord<Contact>() { var name : String = "" var phoneNumber : String = "" var info : String? = null }...

Simple Android Studio TextView Code Using Java

java,android,android-studio
I am trying to create a TextView in Android Studio using the code on their reference (I already know I can use XML but I am trying to learn java). My code doesn't work and I can't figure out why. I look just like the code on the reference. I...

How to send my project to someone not nearby?

android,android-studio
Sorry for the title , maybe it's a little bit misleading , however I want to send my project as an App file to my mate so he can test it on his mobile Is there anyway to do that ? thanks in advance...

Is there a way to make images take up less space in an apk or will I have to use an APK expansion file? [closed]

android,image,android-studio,apk-expansion-files
I made an app in android studio that has a lot of images, making the app exceed the 50MB limit. I do not fully understand how to make an expansion file so I want to try to avoid it. I copied all the images in each mipmap, can I get...

Android Studio — Changing generation path and filename of both unsigned and signed APKs

android,android-studio
Are there any configuration files where I can change the default path of generated (both debug and release) APKs in Android Studio? Can I change the filename of the generated files so it includes the version or the timestamp?

Android Studio work with module

java,android,android-studio,gradle
In my project I've got a main package and a module (app 2). For the module, I use standard application -> import to project -> change it as library and make dependencies (compile project(':app2')). Everything is ok but when I compile, it installs on my cell phone as two individual...

Invisible folders in Android Studio Project view

android-studio
I have recently switched to Android Studio and try to migrate an ADT project. In the app/src/main/res/ directory I have the values, values-v11 and values-v14 folder. But in the Studio's Project view only the "values" folder is displayed. Why? How to resolve this?

Unexpected Token Error in Android Studio

android,android-studio
package com.hello_world.helloworld; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.util.log; public class HelloWorld extends AppCompatActivity { private static final String TAG - "My Message"; Another error it says is that Private field 'TAG' is never used. I am unsure why i am getting these errors and I need...

Android image fade animation

java,android,animation,android-studio,objectanimator
When I'd ran this code, it did nothing, I'm sure that this event is called when I touch the button. but It doesn't change the opacity of imageView. View.OnTouchListener mDelayHideTouchListener = new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { ObjectAnimator fadeAltAnim = ObjectAnimator.ofFloat(R.id.imgTest, "alpha", 0.2f); fadeAltAnim.start(); }...

Automatically copy .so files from NDK library project?

android-studio,gradle,android-ndk
Using Android Studio 1.2.1.1 with Gradle 1.2.3. I have an NDK library project A that produces a number of .so files in its own libs folder. Though, I cannot see the reference to this folder anywhere in the build.gradle file. When I reference library A from my app MyApp I...

How to put Like function under an image and save the “Liked” status?

java,android,android-studio,imageview,sharedpreferences
I'm trying to figure out how to put a "Like function" to a few local stored images and remember the app that the user liked those images. Let me explain: I want the user to be able to press "Like" under the image he likes. This means the "Liked" status...

Use higher API level in android with an external library

java,android,api,android-studio,material-design
Would it be possible to import an external library (.jar file) in an android project containing the features of API level 21, and then use them in my application with a minimum sdk version set to say like 17? I'm really into Matierial Design but as Google states, "To use...

Android build project error trying to build apps > 65K (65536) methods

android,android-studio,gradle,build,android-gradle
I have added these two new dependencies in my build.gradle compile 'com.android.support:appcompat-v7:22.2.0' compile 'com.android.support:design:22.2.0' And right now, I can't build my project because I've got an error. I have found information about the error and the solution that I have found says that I have to add ... compile 'com.parse.bolts:bolts-android:1.+'...

Android _ failed for task ':app:packageAllDebugClassesForMultiDex' _ AbstractDateTime.class?

android,android-studio
My Project was working fine, when I have added bellow code in my project get me error, I add : compile 'joda-time:joda-time:2.7' compile 'net.danlew:android.joda:2.8.0' Here is my build.gradle : apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "22.0.1" defaultConfig { applicationId "us.app.recyclerview_multiselect" minSdkVersion 14 targetSdkVersion 22 versionCode 1 versionName "1.0"...

Can't migrating AndroidManifest.xml file to Android Studio?

android,android-studio
When i try to migrating Eclipse ADT project to Android Studio using "Import project (Eclipse ADT, Gradle, etc.)" then selecting project root folder and then third window gives me error like this C:\Users\Tsomone\workspace\cims-android-app-new\AndroidManifest.xml: Invalid XML file: C:\Users\Tsomone\workspace\cims-android-app-new\AndroidManifest.xml: Premature end of file. and when i try to click Finish, it shows...

Android studio can not resolve com.google.android.gms.location.places.AutocompleteFilter

android,android-studio,google-play-services,google-places-api
I am trying to implement a autocomplete places search following this article. http://www.truiton.com/2015/04/android-places-api-autocomplete-getplacebyid/ I have followed all steps, and also added proper dependencies in my build.gradle file. dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:21.0.3' compile 'com.google.android.gms:play-services:6.5.87' } Also here are the meta data section in my manifest. <meta-data...

Android Studio Library Projects (Modules) show up as different Build Variants

android,android-studio
I'm new to Android Studio so please forgive me if this question has been answered or the reason is obvious, but..... All of my library project dependency modules are showing up with different build variants in the Build Variants pane of Android Studio. For example, my app uses the library...

How to download a library dependence on gradle for external use?

cordova,android-studio,gradle,android-gradle,cordova-plugins
I have a project on PhoneGap and I am trying to build a plugin to use a FilePicker library. So, I build one Android Studio Project and I have it working. So, right now, that I know that I know how to do it, I just need to know how...

Reset Android Studio settings to default setting on linux

android,android-studio
everyone. I used to develop android application on Mac. Recently I installed android development environment on my Thinkpad which running Xubuntu. I imported the Android studio settings on Mac to the Android studio on Xubuntu via File-> import settings. But after I have done this, everything goes wrong. The hotkey,...

Android getSupportedPreviewSizes() on Camera returns only 3 sizes

java,android,android-studio,android-emulator,android-camera
I'm using the Android Camera API to build a camera app and I need to set the preview size of the camera. I've read that I'm supposed to call getSupportedPreviewSizes() on my camera object's Parameter object to obtain a list of every supported size. The problem is that this list...

Twitter4j - cannot resolve method - setUsessl(boolean)

android,android-studio,twitter4j
I'm using twitter4j 4.0.3 core I have this code: public final class TwitterUtil { private RequestToken requestToken = null; private TwitterFactory twitterFactory = null; private Twitter twitter; private TwitterUtil() { ConfigurationBuilder configurationBuilder = new ConfigurationBuilder(); configurationBuilder.setOAuthConsumerKey(ConstantValues.TWITTER_CONSUMER_KEY); configurationBuilder.setOAuthConsumerSecret(ConstantValues.TWITTER_CONSUMER_SECRET); configurationBuilder.setUseSSL(true); Configuration configuration =...

Duplicate entry for class in gradle

java,android,android-studio,gradle
I am trying to implement ken burns view in android studio in my app, i have importted the folder which contains its classes, but gradle gives me this error Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'. > java.util.zip.ZipException: duplicate entry: com/flaviofaria/kenburnsview/MathUtils.class Here is my build.gradle apply plugin: 'com.android.application' android { compileSdkVersion 21...

How to determine Android Full SDK Download size?

android,android-studio,android-sdk-tools
I'm asked to report Download size of Full Android SDK (Not Disk Size). On Disk : 49GB On Network (Downloaded Zip Files): ?GB Installed: Windows 7 x64 machine Tools till 24.3.1 Tool preview channel Android M Android API (22, 21,20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10,...

Android Studio HAXM not working

android,android-studio,haxm
I want to use android studio on a hp with E2 AMD vision processor. The problem is that when I download the HAXM installer from the SDK manager and try to install it I get an error saying that my computer does not support this program. I went to the...

Android Studio plugin for capture Strings

android,string,android-studio
I'm searching a plugin for Android Studio that help me catch the Strings in my APP, I don't use the recomendations of the Android and make my APP using Strings hardcoded. How do you capture the Strings of codes of automatic way? [I've searched in the google (web) but I...

Add Event Handler to ImageButton

android,android-studio
I am developing an Android app that has an ImageButton in it, and I need to add an event handler to it. In my attempt to do this, I have added a new function to the .java file that Android Studio creates when you make new project that looks like...

Make Robolectric run test for the current build type only

android-studio,robolectric
I'm using Robolectric alongside Android Studio (v 1.2.2) classpath 'com.android.tools.build:gradle:1.2.3' buildToolsVersion "21.1.2" testCompile 'org.robolectric:robolectric:3.0-rc3' My project contains 4 build types. In spite of having debug build type selected in the "Build Variants" window, Robolectric tests every declared build type (4 times). Is it an expected behavior? How can I narrow...

Proguard - also use proguard files from modules

android,android-studio,gradle,proguard,android-proguard
My projects build.gradle looks like following: android { compileSdkVersion 22 buildToolsVersion "22.0.1" defaultConfig { applicationId "..." minSdkVersion 15 targetSdkVersion 22 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile project(':androKnife') } And my androKnife module does have it's own...

PDF file path is incorrect [duplicate]

java,android,pdf,android-studio,filepath
This question already has an answer here: Android - Access file from assets \ PDF display 4 answers I want to open a PDF file in my application but something goes wrong everytime. Yeah , I watched many topics about it, however none of them helped me. Here are...

can anyone tell me how to store geocoder address in android database using android studio?

android,android-studio,android-sqlite
I am able to see the address(for on click listener) fetching from the GeoCoder code and i am able to display in log file but i am not able to store that address in my local DataBase. can any one please help me in this issue. thanks in advance. package...

Error:(12) No resource identifier found for attribute 'scalteType' in package 'android'

android,android-studio
Getting error messages when running an app on debug mode during the Gradle Build in Android Studio. This is the error message: Information:Gradle tasks [:app:assembleDebug] :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72211Library UP-TO-DATE :app:prepareComAndroidSupportSupportV42211Library UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig...

Android studio gradle flavor dimensions build varients not working correctly

android-studio,gradle,android-gradle,build.gradle,android-productflavors
I have two dimensions of an app, call then green and blue. There will only be these two dimensions but an unlimited number of product flavors. This is the way I'm setting it up in gradle flavorDimensions "green", "blue" productFlavors { one { applicationId "com.app.green.one" versionCode 1 versionName "1.0.0.1"; flavorDimension...

Trouble implementing android_serialport_api into my own application

android,android-studio,serial-port,embedded-linux,beagleboneblack
I am currently working on an embedded system for my company that runs the android 4.2 OS (from TI bbb source) on the Beaglebone black. I have been tasked with setting up communication with the serial port (UART). I have been able to configure the serial port and run the...

Can I replace ActionBarActivity with AppCompatActivity in a Tabbed Activity in Android Studio?

android-studio
The following Tabbed Activity is created by Android Studio 1.2.2 Wizard, it works well in API 9, but someboyd told me that ActionBarActivity is deprecated, so I hope to replace public class MainActivity extends ActionBarActivity implements ActionBar.TabListener with public class MainActivity extends AppCompatActivity implements ActionBar.TabListener , and stay all other...

Cant start developing for android

android,android-studio
I have an app on iOS and now i need an android version. BUT I CANT. I downloaded android studio, downloaded everything from SDK manager, did everything for a basic project. But... Everything i use is deprecated. Tried making tabbed application... ActionBarActivity deprecated, every other thing i trie is deprecated......

android studio “Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly”

android-studio,gradle,android-gradle
I don't understand the error says Error:Failed to create parent directory 'C:\Program Files\Android\Android Studio\gradle\daemon' when creating directory 'C:\Program Files\Android\Android Studio\gradle\daemon\2.2.1' ...

Cannot resolve method 'openFileOutput(java.lang.String,int)

java,android,android-studio,android-file
A night before, I implemented a code snippet in Android studio to access a file and write a string in a file.But some how I am not able to build it sucessfully. I don't know what is wrong with "openFileOutput()" method. I have already tried adding context before openFileOutput() method,...

Android SQLite issue: 'Table […] has no column named' error

android,sqlite,android-studio,android-sqlite
I keep getting error that a column in my table cannot be found. Cannot figure out why this is happening. The column names appear to be spelled correctly. I'm getting this error : 06-11 21:27:02.701 3703-3703/com.example.luca.contatti E/SQLiteLog﹕ (1) table Contatti has no column named imageUri This is my DatabaseHandler page:...

Unhandled Exception when calling SipProfile.Builder from Android SIP Class

java,android,object,android-studio,compiler-errors
There is an error when creating a Builder object. This is my code: SipProfile.Builder builder = new SipProfile.Builder("address","username"); The error:: unhandled exception: java.text.ParseException This is a sample from Android Reference.: public SipProfile mSipProfile = null; ... SipProfile.Builder builder = new SipProfile.Builder(username, domain); builder.setPassword(password); mSipProfile = builder.build(); http://developer.android.com/guide/topics/connectivity/sip.html#manager...

How can make the width of string the same in Android?

android,android-studio
There are 3 strings, each the length of string is the same, there are spaces in the those strings. After I fill the 3 strings in a ListView control, I find the width of the 3 row isn't the same. How can I make the width of string the same...

Error execute studio.sh unrecognized vm option 'MaxPermSize=350m' on Ubuntu 14.04

ubuntu,android-studio,ubuntu-14.04
Error to Execute/Install studio.sh on Ubuntu: [email protected]:~$ cd android-studio/bin [email protected]:~/android-studio/bin$ ./studio.sh Unrecognized VM option 'MaxPermSize=350m' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. And with some knowledge after searching on search engines, I open the studio.vmoptions file in edit mode and...

Close module in android studio

android,eclipse,android-studio
in eclipse there is simple option to close or open project. How can I do it in android studio to close and open module without import it and delete each time?

Android Studio javax.mail jar build error

java,android,email,android-studio
I'm trying to use the Gmail API to send emails. I've followed the Google documentation on how to do this. I need access to MimeMessage which is from the import: javax.mail.internet.MimeMessage; Since this is not included by default in Android Studio I downloaded the .jar files and did. File ->...

How can IntelliJ refactor class constants to an external class?

java,intellij-idea,android-studio
I have a series of 30 or so private class constants declared and used in Fragment.java. I want to refactor the declarations into public declarations in Constants.java such that all occurrences of VARIABLE_NAME in Fragment.java are replaced with Constants.VARIABLE_NAME Tips appreciated on how to use this. I am using Android...

Error trying to call .buildClassifier (Weka) in Java AndroidStudio

java,android,android-studio,weka
I am trying to use Weka in Android Studio. And I am stuck at the this line: linearRegresion.buildClassifier(data); Its red underlined and it says: Unhandled Exception:Java.lang.Exception I was trying other ways and with different dataSet and its allways underlined at .buildClassifier //test: NaiveBayes nB = new NaiveBayes(); nB.buildClassifier(dataSet); //Unhandled exception...

Simplest way to create a Shape in Android Studio

android,android-studio
What is the easiest way to create a Circle in Android Studio (1.2)? I understand I can do it through using canvas code or writing XML code somewhere, but this seems really complex. None of the guides on the internet seem to provide a simple way. Simple would be drag-and-drop...

ClassNotFoundException on android blank activity

java,android,android-studio,classloader,classnotfoundexception
I am having a problem with Android Studio (1.3 dev channel). I created the default blank activity from the menu (File->New->New project, and then API 16 as minimum SDK, Blank Activity, default settings). I wanted to test, with such a simple setup, if I can load the class called MainActivity...

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException

android,android-studio,gradle,multidex
I am using Android studio 1.2.2. I've integrated maps 4 work sdk, after this the Build is failing, We are using google play services lib in our project (using only com.google.android.gms.tagmanager.*). Now after integrating googlemaps_sdk_m4b_lib, the build is not getting generated. before to this inte Tried looking for including only...

Android studio how to put the logcat window back to original place

android-studio,logcat,setting
I have drag the log cat window out of the Main window, how can i put i back. I have tried double click the window or do something else. but i could not find the right way to put the window back....

Cannot resolve symbols setAdapter and AttachToListView in Android Studio

android,android-studio
I was attaching the list view to FAB, but Android Studio is showing the following error: cannot resolve symbol at setAdapter and AttachToListView methods I tried rebuilding and closing and reopening the project. Code: public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } String[]...

PNG transparent backgrounds appearing black when using Android Studio

android,android-studio,png,adt,android-drawable
The social icons below (for fb, twitter, mail and share) are circular PNGs with transparent backgrounds. When I use the code and exact same images in Eclipse, I get transparent background but when build and run with Android Studio, I get black backgrounds. See details below. Images are the same....

Choosing specific ports on local development server for non-default modules

java,google-app-engine,android-studio,gradle,app-engine-modules
In my build.gradle file, I use the following config for my non-default (module2) AppEngine gradle module: appengine { downloadSdk = true httpAddress = "0.0.0.0" httpPort = 8081 appcfg { email = "[email protected]" oauth2 = true } } However, when I run my "Google AppEngine configuration", the module still starts on...

Issue in Parcelable implementation in Android Studio 1.2.2 Upgrade

android,android-studio,parcelable
My Parcelable Class : public class Category implements Parcelable{ int id; String name; Department department; @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(id); dest.writeString(name); dest.writeParcelable(department, 10); } public static final Parcelable.Creator<Category> CREATOR = new Parcelable.Creator<Category>() { public Category createFromParcel(Parcel in) {...

Gradle Compilation Errors when adding 'com.amazonaws:aws-java-sdk:1.10.1'

java,amazon-web-services,android-studio,build.gradle
I am running Android Studio and my app has been running perfect until I do the following. When I add "compile 'com.amazonaws:aws-java-sdk:1.10.1'" to my gradle file, I get the following warnings when I do a project re-build. Warning:Dependency commons-logging:commons-logging:1.1.3 is ignored for debug as it may be conflicting with the...

Android project: errors after changing machine

java,android,eclipse,android-studio
So I am more than halfway through this book, Android Programming: The Big Nerd Ranch Guide, and I was almost finished with the CriminalIntent app when I had to change from desktop to laptop. I just copied workspace and installed eclipse and SDK. Now logcat gives me this when trying...

App crashing after pushing button, but the action is working

android,button,android-studio,compiler-errors
Maybe someone sees an error, the problem is that when i push btn2 (button 2) and btn3 (button 3) app crashes, but action still works, i.e video is running and PDF opens, while button 1 is working correctly... @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); configureImageButton(); mCamera = getCameraInstance();...

where to change the project configuration into the updated build tool revision in android studio?

android,android-studio
In my android studio project, I have pre-installed Build Tools 24.3.2 and 22, however a sample project I am going to run requires Build Tools revision 21.1.2 Error:failed to find Build Tools revision 21.1.2 I wonder could I not install the Build Tools revision 21.1.2 and just change the project...

Android Studio Create Database error (android.database.sqlite.SQLiteException: near “and”: syntax error (code 1): ) Detailed Analysis

java,database,android-studio,android-sqlite
I'm trying to use the database and it complains about my "CREATE TABLE". I looked at different posts and "updated mine on here for the changes I made to CREATE TABLE). It looks correct compared to other posts and forums, so I am not quite sure why it keeps failing....

Huge unusable font size in Android Studio

android,android-studio,fonts
As the title states, I've inadvertently set the font size to something gargantuan in Android studio and it's now totally unusable. At most I see the tops of a few letters once the program loads, so I can't even get back into the options to reduce the font size. Looking...

Logcat goes crazy on Android Studio

android,android-studio,android-logcat,android-debug
Since version 1.2.2 of Android Stduio, LogCat doesnt appear to be able to only filter the output messages of my app. Instead, it filters all my device messages. I have Log level "Debug" and "Show only selected application" enabled. Here's a screenshot of my LogCat: http://imgur.com/gErued1 Edit: why I'm being...

how make Sync or Async HTTP Post/Get in Android Studio

android,http,android-studio
I'm beginner in Android programming. I'm using Android studio to develop some simple app. At this moment I need Sync or Async HTTP Post/Get to get HTML data from Web-Service. I search this whole internet but I can't give good result. I tried to use this examples: Android Series get/post...

Install Ultimate edition IntelliJ plugins in Android Studio

android,intellij-idea,android-studio
I have Ultimate edition of IntelliJ Idea w/ a valid licence. There is a very useful plugin only available in full edition named Database Tools and SQL support that allows the developer to browse and run queries on sqlite database stored in phone. Now i need to use this plugin...

populating a text view in an android Fragment from a text file in /res/raw

java,android,android-fragments,android-studio
I am attempting to populate an textview in an android fragment. I am having no luck at all as the fragment is blank. I know I am fundamentally missing something. I have read the docs on fragments and I am still confused. Below is my code for one of the...

Android Studio and gradle

android,android-studio,gradle
I tried importing Xabber ( GitHub ) within Android Studio , I did the git init etc . Now I find that I can start the app for that problem Gradle , I've looked everywhere , but could not find anything that would work .. The problem is: Error:Execution failed...

Show notification in Adroid 5.0.1

java,android,android-studio,notifications
I want to create a Notification in my Android App, but my code doesn't work! NotificationManager nManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); Notification.Builder nBuilder = new Notification.Builder(this); nBuilder.setContentTitle("Title..."); nBuilder.setContentText("Text..."); nBuilder.setContentInfo("Info?"); nBuilder.setWhen(System.currentTimeMillis()); //Intent notificationIntent = new Intent(this, MainActivity.class); //PendingIntent pendingIntent = new PendingIntent.getActivity(this, 0,...

XML parsing error (android studio)

android,xml,android-studio
I have made an xml file (using android studio), which allows me to have a tool bar throughout my android application. However, I just keep on getting the following error: ?xml version="1.0" encoding="utf-8"? android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/ColorPrimary" android:elevation="4dp" > android.support.v7.widget.Toolbar Errors: Error:(2) Error parsing XML: XML or text declaration not...

Getting processDebugResources error in Android Studio

android,android-studio
I am getting an error when I try to compile the project in android studio like this, Error:Execution failed for task ':app:processDebugResources'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'E:\adt-bundle- windows-x86_64-20140702\sdk\build-tools\23.0.0_rc2\aapt.exe'' finished with non-zero exit value 1 What is the reason for this? How to solve this? Thanks....

Having problems while trying to delete single rows from a custom ToDo list?

android,android-fragments,checkbox,android-studio
I want to delete selected rows from a todo list by clicking on the checkbox and deleting them trough the delete button, for that I am within my custom adapter setting a setOnCheckedChangeListener on my checkbox and setOnClickListener on my delete button, now keep in mind that the delete button...

Android Studio Error: 'command 'C:\Program Files\Java\jdk1.7.0_75\bin\java.exe'' finished with non-zero exit value 2

android,android-studio
I am getting this error after adding a libriaes project while try to run the application. Android Studio version : 1.2.1.1 Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_75\bin\java.exe'' finished with non-zero exit value 2 ...

Failed to create JVM in android studio

android,android-studio,jvm
I set the JAVA_HOME and PATH in environment variables but now android studio is giving to me a new error. here is error: Failed to create JVM:error code -6. JVM path:C:\Program Files\java\jdk1.9.0 if you already have a 64-bit JDKinstalled, define a JAVA_HOME variable in ...

Android Studio : UNEXPECTED TOP-LEVEL EXCEPTION:

java,android,android-studio,android-gradle,build.gradle
How Can I solve this error Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2 App Build.gradle apply plugin: 'com.android.application' android { compileSdkVersion 22 buildToolsVersion "22.0.1" packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/ASL2.0' exclude 'META-INF/NOTICE' exclude...

getView method causing NullPointerException

java,android,android-studio
I'm getting a NullPointerException, when I'm trying to get some image from database I think my getter and setter method is wrong, any help is much appreciated. This is my Activity public class ViewMoreDetailsImages extends Activity{ ProgressBar progressbar_01; ListView lv_images; ImageAdapter imageAdapter; List<ImageInformation> imageInformationList = new ArrayList<ImageInformation>(); @Override protected void...

java.lang.NoClassDefFoundError: android/support/v7/internal/widget/ActionBarOverlayLayout$1

java,android,android-studio
Here is my stack-trace. Exception Details java.lang.NoClassDefFoundError: android/support/v7/internal/widget/ActionBarOverlayLayout$1 at android.support.v7.internal.widget.ActionBarOverlayLayout.<init>(ActionBarOverlayLayout.java:91) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at android.view.LayoutInflater.inflate(LayoutInflater.java:482) at android.view.LayoutInflater.inflate(LayoutInflater.java:414) at...

If I change ID of an element in Android Studio, how do I carry on this change throughout the code?

android,android-studio
For example, say I'm using a relative layout and a lot of views are centered around a TextView with ID of TextView. If I change this ID to TextView1, the other elements referencing it all break. How can I change the ID so that the changes are carried out? Thanks...

Null Pointer Exception when writing to a File - Android Studio

java,android-studio,nullpointerexception
My app crashes every time I go to send the data gathered by the sensor. The error I am given is as follows: 06-20 14:50:00.784 22983-22983/com.example.adam.proj2 E/AndroidRuntime﹕ FATAL EXCEPTION: main java.lang.NullPointerException at com.example.adam.proj2.SensorActivity.onClick(SensorActivity.java:124) at android.view.View.performClick(View.java:3549) at android.view.View$PerformClick.run(View.java:14393) at android.os.Handler.handleCallback(Handler.java:605) at android.os.Handler.dispatchMessage(Handler.java:92) at...

Countdown Timer Notification

android,android-activity,android-studio,background,countdowntimer
I'm begginer in Android programming, I have to do a CountdownTimer that starts from a number selected by the user using a two number pickers (one for Hours and other for minutes). The characteristics must be: -The CountdownTimer must work in background and notify the user when it arrives to...

how to add menu items to action bar in more than 30 activities

android,android-activity,android-studio,menu,menuitem
I have created an app in android studio that has more than 30 activities .I created menu items in some activities by adding them in individual menu files and they worked fine . But the problem is that it is a real headache to add all the menu items in...

Team explorer for android studio like visual studios [on hold]

android,android-studio
Is there any plugin for android studio that would enable 2 computers running android studio to run the same project and synchronize the files whensoever its edited on one computer to both of them? If not,can we use git to do the same ?

Create menu from button?

android,android-studio
I would like to create menu where I can select how to sort posts. On iOS exists something like this: It's something similiar on Android? Or can give me advice which component I should use to solve my task? My app:...

Android Studio: cannot upgrade google play services

android,google-maps,android-studio,google-play-services,google-play-developer-api
I have tried download the latest version on the sdk manager, but is still not working. I have seen other posts telling users to enter the following... compile 'com.google.android.gms:play-services:4.2.+' I do not understand where to enter it. I tried in the terminal feature of the android studio but it gives...

How can I control android webview activity changes when I change screen orientation?

java,android,android-studio,android-webview,screen-orientation
import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.res.Configuration; import android.graphics.Bitmap; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.os.Bundle; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v4.widget.SwipeRefreshLayout.OnRefreshListener; import android.support.v7.app.ActionBar; import...

Why does Gradle disregard release{} and implement a rule on debug build as well?

android-studio,android-gradle
I am not sure if this happened before, but I think it happened after the recent updates of Android Studio and its Gradle. Namely, I am trying to set the output path of the release APK. So I made a code like this buildTypes { release { minifyEnabled false proguardFiles...

Resetting an Inflated ListView's height, Listview height

android,android-listview,android-studio
I have a main activity and its layout is a scrollView and has a "linear layout" called [taskLayout]. setContentView(R.layout.my_jobs_view_single_holder); final LinearLayout taskLayout = (LinearLayout)findViewById(R.id.TaskLayout); Then i'm inflating another view and adding the view to the main scrollviews.TaskLayout section. LayoutInflater pickup_inflater = (LayoutInflater)getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); View view = pickup_inflater.inflate(R.layout.my_jobs_view_single_pickup,null);...

Android Studio manifest Errors

java,android,android-studio
Could anyone please me as when ever I try to run my app I get errors in the manifest file such as the followig five errors below. Error:(2) No resource identifier found for attribute 'versioncode' in package 'android' Error:(2) No resource identifier found for attribute 'versionname' in package 'android' Error:(9)...

Want to perform an action on a button press rather than a button click

java,android,android-studio
I need to execute some code upon the press of a button, but right now I have and can only find information on executing code upon the click of a button (press and let go). How can I set a press listener or something like this? This is what I...

app crashes with no input while using Edittext in android studio

java,android-studio,android-edittext
I am having this issue with Edittext in android studio.The app works fine but app crashes with no input Here is the java code public void onButtonClick (View v) { int num1,num2,sum; EditText e1 = (EditText)findViewById(R.id.num1); EditText e2 = (EditText)findViewById(R.id.num2); TextView t1 = (TextView)findViewById(R.id.sum); num1 = Integer.parseInt(e1.getText().toString()); num2 = Integer.parseInt(e2.getText().toString());...

button.setPressed(true) suddenly not working

java,android,android-studio
I have been using an emulator with the following code to press a particular button redBut.performClick(); redBut.setPressed(true); redBut.invalidate(); redBut.setPressed(false); redBut.invalidate(); Using Log statements, I know for sure this piece of code is being called, so it is not that the code is being skipped over. On my emulator, the button...

Android Studio incorrect package name

android,eclipse,android-studio,android-gradle,packages
I recently changed the package name of my Android application in the Eclipse IDE. Then, I imported it into Android Studio. However, I noticed when running the app that it said Target device: AVD_for_10_1_WXGA_Tablet [emulator-5556] Uploading file local path: C:\Users\User\StudioProjects\AppName\app\build\outputs\apk\app-debug.apk remote path: /data/local/tmp/com.oldpackage.appname Installing com.oldpackage.appname DEVICE SHELL COMMAND: pm install...

Android device monitor seems to miss crashes

android,android-studio,logcat,android-logcat
At seemingly random occasions it looks like Log cat in Device monitor bundled with Android studio misses error messages. I have an app that crashed on different errors, Index out of bounds to mention one. At some occasions this crash was shown in the log, at other occasions it showed...

Generated source files should not be edited?

java,android,android-studio
When I create this new class Quake and try to write some code in it ,it displays the following message, and when I try to run it Android Studio automatically delete the class Quake. Can someone explain me why is this happening and how to resolve it ?...

ProGuard issues with Android Archieve(.aar) library

android-studio,proguard,aar
I've a library project which I want to distribute, in AAR format. I've applied ProGuard on it. ProGuard settings works well if I use this lib as a module, but not when I use resulting AAR. Basically it fails with exception "java.lang.IllegalArgumentException: already added Lmy/lib/package/name/R;" in Application project. ProGuard is...

How to set max line length in Android Studio code editor?

android-studio
How can I set a maximum length for Android Studio's code editor, or may be set a word wrap? In my Android Studio, no matter how long a statement I type on a single line, it never automatically goes to the next line, but rather a horizontal scroll bar appears....

Unfortunately Application has stopped after running it from Anroid Studio

java,android,android-studio
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="30sp" android:textStyle="bold" android:padding="15dp" /> </LinearLayout> That is the customized layout xml file I am trying to create. Here's my code for...

android studio casting warning

android,android-studio
I mistakenly disable this feature but I don't know how to enable again. The feature is that warns me when I cast an object to another class. For example: ImageView scanner; TextView errorMessage; @Override protected void onCreate(Bundle savedInstanceState) { errorMessage = (TextView) findViewById(R.id.errorMessage); scanner = (TextView) findViewById(R.id.scanner); // studio warns...

Android - Custom Home Application Doesn't Appear When Click Home Button

android,android-studio
I'am using Android Studio and I have developed an Home Application by adding <activity android:windowSoftInputMode="stateAlwaysHidden" android:screenOrientation="landscape" android:launchMode="singleInstance" android:stateNotNeeded="true" android:name=".MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.HOME" /> <category android:name="android.intent.category.DEFAULT" /> <category...

ImageButton Not clickable - AndroidStudio

java,android,android-layout,android-studio
I have these declarations for 4 ImageButtons on my Android app, but so far they aren't clickable, this is my class: public class WelcomeScreen extends Activity { ImageButton completeprofile; ImageButton gotoportfolio; ImageButton findfriends; ImageButton readnews; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.welcome_activity); completeprofile = (ImageButton) findViewById(R.id.completeprofile); gotoportfolio = (ImageButton) findViewById(R.id.gotoportfolio);...