If you are using Gradle , you already know many of these tips. In the last days many devs (they are using Eclipse) asked me some questions about Gradle. I will not talk about what is Gradle, because you can find very good tutorial about it. I will collect some common (and basic) cases. First of all, if you are looking for a good tutorial, I suggest you these links: Official Guide Mark Allison's series Android Studio IDE helps you to manage Gradle files, but I suggest you understand what are the gradle files, so you can easily edit them manually. I've just created a new project It is important to understand the gradle structure. - root - myProject build.gradle setting.gradle build.gradle At the root project you will find 2 files: settings.gradle build.gradle settings.gradle tells Gradle at build time that there are sub-projects to build. Here an example: include ':myPproject' build.gradle defines how to build the project/module.
Showing posts from October, 2013
- Other Apps
In last days in my Card library , I tried to export a View as a Bitmap. A simple way to export the view is to use following code: Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); view.draw(canvas); Pay attention where you will use this code . If you use this in onCreate() method, the View didn't go through a layout, so its size is null (0x0). In these cases you have to use something like this before drawing the bitmap: view.measure(widthSpec, heightSpec); view.layout(left, top, right, bottom); An example: int spec = MeasureSpec.makeMeasureSpec(0,MeasureSpec.UNSPECIFIED); view.measure(spec,spec); view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight()); Bitmap b = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888); Canvas canva