Sunday, December 4, 2016

Grails - Introduction

I would like to give you a little introduction of grails in newbie term.

If you have decided to start doing web development or learning web development in java then Grails is for sure an good candidate for you to pick and learn

Grails provide the framework based on following

1. Hibernate - ORM layer
2. Groovy Server Pages - Presentation/Web layer
3. Spring - Controller layer

Why I started to learn grails has a different reason ;) but would suggest techies to just have a look if you choose to go with Java Web Project and would like to reduce some development time

Mobile Application - Change Icon using android Studio


Use below step to change icon of your mobile application using Android Studio.
  1. Open your android application project in android studio
  2. On res folder right click and select new image asset

       
    3.Select asset type as image and browse to select the new icon file

    
   4.Android studio will warn you of a file override. Click finish to continue

Android studio failed to display design mode

While staring my basic application I was unable to view the layout xml in design mode.

Following was my configuration.
Android Studio 2.1.3
Created new project with empty activity
Clicked on res/layout/activity_main.xml and tried to open and found exception

java.lang.NoSuchMethodError: android.graphics.drawable.VectorDrawable_ android studio.......

on clicking details I found following detail exception



java.lang.NoSuchMethodError: android.graphics.drawable.VectorDrawable_Delegate.nDraw(JJJLandroid/graphics/Rect;ZZ)I
at android.graphics.drawable.VectorDrawable.nDraw(VectorDrawable.java)
at android.graphics.drawable.VectorDrawable.draw(VectorDrawable.java:304)
at android.widget.ImageView.onDraw(ImageView.java:1286)
at android.view.View.draw(View.java:17056)
at android.view.View.draw(View.java:16964)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:3715)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:61)
at android.view.ViewGroup.drawChild(ViewGroup.java:3715)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3501)
at android.view.View.draw(View.java:17059)
at android.view.View.draw(View.java:16964)
at android.view.ViewGroup.drawChild_Original(ViewGroup.java:3715)
at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:61)
at android.view.ViewGroup.drawChild(ViewGroup.java:3715)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3501)
at android.view.View.draw(View.java:17059)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.render(RenderSessionImpl.java:384)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.render(RenderSessionImpl.java:495)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:434)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:520)
at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:508)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:967)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:508)
at com.android.tools.idea.rendering.RenderTask.access$600(RenderTask.java:75)
at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:620)
at com.android.tools.idea.rendering.RenderTask$3.call(RenderTask.java:617)
at com.android.tools.idea.rendering.RenderService.runRenderAction(RenderService.java:371)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:617)
at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:639)
at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$7.run(AndroidDesignerEditorPanel.java:519)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:337)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:327)
at com.intellij.util.ui.update.MergingUpdateQueue$3.run(MergingUpdateQueue.java:271)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:286)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:244)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:234)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:352)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
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)




To solve this I have to change the preview API from
API 23 : Android API, N Preview (Priview)
to
API 23: Android API