w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Import an Android Project from Eclipse to Android Studio and I have this error message "failed to find Build Tools revision 8.0.0"
Your build.gradle is trying to use Android SDK tools 8 which isn't installed on your machine. If you look at your build.gradle file you probably have this line buildToolsVersion "8". You want your build.gradle file to point to the Android SDK tools that you currently have installed (preferably the latest). Just open the Android SDK manager and see which tools you have installed and change the buildToolsVersion "8" to the right version.

Categories : Android

Android Studio: how to import Android library project
Go back to Project Structure window where you added the new module. Click on your main module, go to Dependencies tab, click the plus icon and select Module Dependency.

Categories : Android

Facebook SDK import into Android Studio and add it in my app
It does indeed have to do with Gradle structure. Effectively, you need to create Gradle build files for the Facebook SDK. We wrote up a doc that may be able to help you. Give it a shot and be sure to provide us feedback with anything you found ambiguous or difficult, and I will look into it and modify the doc accordingly. Keep in mind that Android Studio is in its early stages as of this writing, so it's possible that as the project progresses we may need to make changes in the doc accordingly. I also found that sometimes I just had to shut Android Studio down and restart it before things would magically start working again.

Categories : Android

Import project into Android-Studio
Managed to solve on my own. Needed to alter the build.gradle file a bit so the buildscript->dependencies will hold this: classpath 'com.android.tools.build:gradle:0.5.+' and not: classpath 'com.android.tools.build:gradle:0.4' Then used the "local gradle distribution" option with the 1.6 version I downloaded and it worked fine.

Categories : Intellij Idea

Import scribe-1.2.1.jar in Android Studio
Edit your module's build.gradle file, just append one line in the dependencies scope. dependencies { ... compile files('libs/android-support-v4.jar') compile files('libs/scribe-1.2.1.jar') } FYI: at this time Android Studio project setting did not affect the gradle build, so you must edit it yourself. there are a user guide for gradle android plugin.

Categories : Android

How can I import library at android-studio?
Android Studio uses Gradle for building. Version 2.2 should pick up all libraries specified in build.gradle file. However, If you change anything in Project Structure dialog it won't update build.gradle file. Open -project_root -module_root build.gradle This file should NOT be empty. There is another empty build.gradle in the project_root folder so do not confuse them. Add all libraries you need inside dependencies closure. Do not confuse dependencies closure with buildscript.dependencies. apply plugin: 'android' repositories { mavenCentral() } dependencies { compile files('libs/android-support-v4.jar') //here is depenency from Maven Central Repository compile 'org.roboguice:roboguice:2.0' //here is dependency from your local libs folder compile

Categories : Android

Android Studio gradle and libraries import
I don't know how to solve your problem, but when I faced problem of third party library use in Gradle build, I solved by following way. Following is my structure of project. GsonDemoProject    GsonDemo       build       libs           android-support-v4.jar           gson.jar       src           main           build.gradle       build.gradle       settings.gradle I edited my build.gradle file which resides in src directory.

Categories : Android

How to import MenuDrawer from SimonVT in Android Studio
If all you need is a menu drawer that opens and closes, you dont need all the configurations, and other stuff that come with the library, I would go with Android's DrawerLayout. Its easy to use and you don't have all the headaches and resource overhead that comes with setting up a library project to use in your project.

Categories : Java

import external library in android studio 0.2.8
Step 1: Select Project > Right Click > Open Module Settings (F12) > Projects Settings > Click Modules. Step 2: Click your Project > you will see 3 tabs : Sources/Path/Dependencies. Step 3 : Select Dependencies tab. You will see green '+' button to the right of 'Scope' title. Click on this and it will allow you to add Jars and libs. PS: make the scope of the added jars/libs as Compile

Categories : Android

How to import Android Studio project in Eclipse?
As the others say, a full import is not possible, but just try a manual 'import'. The key files for an Android project are the Java sourcecode (src directory), the resource XML files and the Manifest. Just create a new Android project in Eclipse and simply copy these files over. You may have to create a new package structure, so construct the necessary packages and copy each sourcefile over and refactor the package name if necessary. If you use any additional libraries, you may have to manually import them as well.

Categories : Android

How to import apklib into Android Studio or IntelliJ project?
I want to answer my own question after I found out recently. If we have module B need module A library. apklib is create as a library and can be use and read from maven to reference. So if set module A in maven's pom.xml dependency, when mvn build it will ask maven to look for apklib. And as IntelliJ and Android Studio, just go to project structure set the module to Android Library, and add module dependency, then like module B can use from module A.

Categories : Android

How to import remote library in Android Studio using gradle?
You can use: compile 'com.nineoldandroids:library:2.4.0+' or if you have the library copied to your project libs directory, you can use: compile files ('libs/ nineoldandroids-2.4.0.jar') however, you can check out my post on getting started with swipelistview: http://modewagon.wordpress.com/2013/09/16/getting-started-with-swipelistview/

Categories : Android

Failed to import Gradle project on android studio
This problem happens when we work with android sdk studio different from what you should do is install Android Support Repository https://sites.google.com/a/android.com/tools/knownissues

Categories : Android

Android Studio import project with gradle changes iml files
The IDEA official documentation is clear about that : Share all the files under .idea directory in the project root except the workspace.xml and tasks.xml files which store user specific settings, also share all the .iml module files. Source : How to manage IntelliJ IDEA projects under Version Control Systems EDIT : But, sharing iml files seems to be wrong. Best thing is to use a similar gitignore file and to import the project in AndroidStudio for each developer.

Categories : Android

Android Studio Import Module Gradle Build Error
Do not add modules through the Studio interface. Always make the changes directly in build.gradle and then reimport into Studio. Also, update the plugin dependency to com.android.tools.build:gradle:0.4.+ to get the latest 0.4.* version.

Categories : Android

How to import Actionbar sherlock library in new latest version of android studio
If your ActionBarSherlock library doesn't contain a build.gradle file, grab it from here: https://github.com/JakeWharton/ActionBarSherlock/blob/dev/actionbarsherlock/build.gradle. Save this file into the root directory of the library. If you're referencing the library from outside of your project directory, you should define where the library is in settings.gradle, like so... project(':actionbarsherlock').projectDir = new File('/path/to/library') and then right before that line, you should have: include ':actionbarsherlock' Now, in your build.gradle file, include the following... dependencies { compile project(':actionbarsherlock') } Now you should be able to build with Gradle. If you're unfamiliar with Gradle, start reading about it here: http://www.gradle.org/docs/current/use

Categories : Android

Android Studio Import Project - Use gradle wrapper "Disabled Option"
do the eclipse step where you export to generate the gradle build file stop importing your project for now and create a new one. close android studio. navigate on your file system to the new project. take the "gradle" folder in there and copy it in to your project. try again. :-)

Categories : Android

Dialogbox background not showing image in whole background in android
Add this to your res/values/styles.xml <style name="Theme.Custom" parent="android:Theme" > <item name="android:backgroundDimEnabled">false</item> <item name="android:windowIsTranslucent">true</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowFrame">@null</item> <item name="android:windowNoTitle">true</item> <item name="android:windowIsFloating">true</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item> <item name="android:windowSoftInputMode">stateUnspecified|adju

Categories : Android

Android Studio: Background task running indefinitely
I've this problem recently and in my case I'm using a linux 64bit SO and my android studio was in a ntfs disk. Since ntfs doesn't support executable permition the file fsnotifier64 was unable to execute and android-studio fallback into a compatibility mode that is much slower. The solution was copy the android-studio folder into my home folder that was ext4 and that way i was able to set permitions.

Categories : Android

Android ImageButton with gradient AND transparent image background[Image included]
I know how to do a gradient and I know how to set a imagebuttons src/bg to a drawable but i have nooooooo idea where to even start with pulling off both at the same time I think what you are referring to as being a gradient is actually a color with transparency value set. From what I can tell, you are looking for something like this: You can achieve this using the following layout: <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" > <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/the_picture" android:src="@color/transparent_color" /> <TextView android:layout_width="wrap_content" android:layou

Categories : Android

Scale background image and foreground image at same ratio in Android
I think you should do it like this according to my skills <ImageView android:id="@+id/imageView1" android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="centerCrop" android:layout_centerInParent="true" android:contentDescription="@string/bg_desc" android:background="@drawable/bg_img" /> May be it will look as you want.

Categories : Android

Android Overlay Image On Top Of Background Image Using XML Selector
// xml <ImageView android:id="@+id/img" android:layout_width="60dp" android:layout_height="60dp" android:layout_gravity="center" android:adjustViewBounds="true" android:background="@drawable/ijoomer_btn_hover" android:padding="5dp" android:scaleType="fitXY" /> // Activity @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView("xml"); img = (ImageView) findViewById(R.id.img); img.setImageDrawable(null); } img.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if(img.getDrawable()!=null){ img.setImageDrawable(null); }else{ img.setImageDrawable(getResources().ge

Categories : Android

Failed to import Gradle project error creating new project with Android Studio
I had same issue with the latest Android Studio () today, and I finally found that configuring a https proxy for Gradle can solve the issue. I only set a http proxy at the beginning. Gradle needs to sync some files via HTTPS. Use IP address instead if hostname of proxy can't work.

Categories : Android

Set the background image in tab in android
I feel its nothing to do with XML coding .. just make some design trick you need to make two different twiky images for each tab icon . make Image background of tab which have little top part transparent (Not selected resource ) make selected image with same size with contain selected background (Selected resource )

Categories : Android

Take an image and set is as the background in android?
To start the camera intent: ... Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); activity.startActivityForResult(takePictureIntent, PHOTO_ACTIVITY_REQUEST_CODE); ... Where PHOTO_ACTIVITY_REQUEST_CODE is just a integer constant unique within activity to be used as request codes while starting intent for results. To Receive photo in the onActivityResult, and update background of the view public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == PHOTO_ACTIVITY_REQUEST_CODE && data != null) { Bundle extras = data.getExtras(); if (extras != null) { Bitmap photo = (Bitmap) extras.get("data"); if (photo != null) { // mView should refer to view whose reference is o

Categories : Javascript

Android Studio fail add libs Universal Image Loader
From the error "package com.nostra13.universalimageloader.core does not exist", it seems like you have not added the source as the library. Right click the "universal-image-loader-1.8.4.jar" file under the libs folder and from the context menu, click "Add as a library" option. If after this you are getting the "ClassDefNotFoundException", please follow the following steps: Add the library to the project. Edit your Gradle build file and add the dependency for the UIL in it Close Android Studio Open command prompt and go to the project's root folder (you will find 'gradlew' file there) and clean your build by issuing the clean command C:CarApplicationProject> gradlew clean Restart Android Studio.

Categories : Android

Android TextView Background Image With Color
I have a simple table layout, in the one of the row, I have time for sun rise in a text view and I am trying to have sun with purple colour for the row as background. How can I achieve this? Save your image in drawable folder , and in your TextView add this line : android:background = "@drawable/your_imagename_from_drawable_folder" I tried creating an image 1000px x 500px with sun and purple background, However, it does not look good on different screen sizes. What is the solution for this, any help would be greatly appreciated. ( This is not accurate answer but it will help you ) this online tool will help you creating images , http://labs.rampinteractive.co.uk/android_dp_px_calculator/ for this , first you have to find your emulator_dp and screen size and you can find it from emulat

Categories : Android

How to add title bar background image programatically in android
You can infalte your custom layout to your title bar like this: requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.your_custom_layout);

Categories : Android

using nine-patch image as Background of Button android
Looking at the image it appears that the image ins't being parsed as a 9patch, it should be saved as img.9.png if not it will appear as a normal image Like this:

Categories : Android

click event on background image in android
Try setting onClick for the parent view of your xml instead. Something like.- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:onClick="click_screen" > ... </RelativeLayout> Or just override onTouchEvent in your Activity like this.- public boolean onTouchEvent(MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { Intent click_screen=new Intent(this, MainActivity.class); startActivity(click_screen); } return super.onTouchEvent(event); }

Categories : Android

Android Blend transparent png image on existing background
This is a common problem on Android. You can't use the Android Bitmap class to load textures that have transparent areas in them. This is because Bitmap follows the Porter-Duff specification for alpha blending, and Bitmap optimizes images with per-pixel alpha by storing them in the premultiplied format (A, R*A, G*A, B*A). This is great for Porter-Duff but not for OpenGL, which requires a non-premultiplied (ARGB) format. This means that the Bitmap class can only be used with textures that are completely opaque (or have no per-pixel alpha). This article details: http://software.intel.com/en-us/articles/porting-opengl-games-to-android-on-intel-atom-processors-part-1

Categories : Android

Android: How do I align textview on a image background that dos not strech in xml
If you want to remove padding, you can use manually set it. However, if you want overlapping elements, you generally want to use FrameLayout. Look here: http://mobile.tutsplus.com/tutorials/android/android-sdk_frame-layout/ Set a gravity inside the frame layout to align it.

Categories : Android

How to change button background with an image from an array (android)?
just try this int[] myImageList = new int[]{R.drawable.image1, R.drawable.image2}; yourbutton.setBackgroundResource(myImageList[1]); all resources files are identified by int value on android, so you need create int array.

Categories : Android

How do I set a background image on the WebView on Cordova/PhoneGap for Android?
I am not sure about setting an image, but you can set the background color using this: <preference name="backgroundColor" value="0x00000000" /> You will add this in: res/xml/config.xml

Categories : Android

Set background image of android.support.v4.view.ViewPager
Finally resolved by explictly setting background image in code like this: private ViewPager mPager; mPager = (ViewPager) view.findViewById(R.id.HView); mPager.setBackgroundResource(R.drawable.chart_bg); Thanks!

Categories : Android

How to set image as background for all Android devices so that stretching does not distort it?
Yes, Please Use 9-Patch image and Please check this on how to draw 9-patch image and also this Video Tutorial

Categories : Android

Android - why does the background image make the buttons look so strange?
The default for Holo buttons are slightly opaque. Just set a background drawable for them! Here's an example of a gray button with a 1px outline. Includes the pressed state. You will set this on the button with "android:background="@drawable/gray_btn": @drawable/gray_btn.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" > <shape> <solid android:color="#ffffff" /> <stroke android:width="1dp" android:color="#E3E3E3" /> <corners android:radius="4dip" /> </shape> </item> <item> <shape> <solid android:color

Categories : Android

Android: How to find scale ratio of background image
Try this: I got this to change the image size depending on the size of the screen, but this could be easily changed by changing int width = metrics.widthPixels; to be int width = bitmap.getWidth(); or whatever you want it to be scaled to. Note width is the size you're going to. public static void changeImageSize(ImageView object, Context context){ DisplayMetrics metrics = new DisplayMetrics(); ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getMetrics(metrics); int width = metrics.widthPixels; int height = metrics.heightPixels; BitmapDrawable bmap = (BitmapDrawable) object.getDrawable(); RelativeLayout.LayoutParams layout = (LayoutParams) object.getLayoutParams(); float bma

Categories : Android

CSS to set background image fixed on android mobile phones?
Try this: html, body { height: 100%; margin: 0; overflow-x: hidden; overflow-y: auto; padding: 0; width: 100%; background-image: url("images/320htmlbackground.png"); background-repeat: no-repeat; background-position: center center; background-attachment: fixed; }

Categories : Android

Change the Layout Background using image color code in Android
Loop through all the pixel's color data and average the color values, ignore anything that is a shade of grey or transparent. I believe that is what Microsoft does in Windows 7 based on a recent blog post. See this blog post: http://blogs.msdn.com/b/oldnewthing/archive/2011/12/06/10244432.aspx This link showing how Chrome picks the dominant color may also be helpful. http://www.quora.com/Google-Chrome/How-does-Chrome-pick-the-color-for-the-stripes-on-the-Most-visited-page-thumbnails Find this snippet for android http://forums.makingmoneywithandroid.com/android-development/406-%5Bhow-%5D-get-average-color-drawable-bitmap.html

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.