Monday, December 7, 2015

Android App Development: Tips and Tricks

This blog talks about some useful tips while building an Android Application


  1. How to make your application run using internet

    Add this to your AndroidManifest.xml just before the <application> tag.
    <uses-permission android:name="android.permission.INTERNET"/>

Monday, November 30, 2015

Android Development: Common Issues and Solutions


This page describes some of the common issues I faced while developing an Android App. Hope you find it useful.

I am using Android Studio version 1.4.1


  1. Cannot resolve symbol 'R'

    Issue: While getting a handle to a component through its id, I used - R.id.<id> and it was erroring out with the message- 'Cannot resolve symbol 'R'

    Solution: Build your project and clean gradle. Click on Build > Clean Project.
  2. You need to use a Theme.AppCompat theme (or descendant) with the design library

    Issue: While selecting an app theme, say, 'Material Light' got the following error-
    java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the design library.
         at android.support.design.widget.ThemeUtils.checkAppCompatTheme(ThemeUtils.java:34)
         at android.support.design.widget.AppBarLayout.<init>(AppBarLayout.java:145)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

    Solution: Remove tools:showIn="@layout/activity_main" in content_main.xml under RelativeLayout tab. If you are having activity_main.xml, try using 'Empty Activity' instead of 'Blank Activity'.

  3. Issue: couldn't resolve resource @dimen/activity_horizontal_margin (4 similar errors not shown)"
    " @dimen/activity_horizontal_margin " in attribute "paddingLeft" is not a valid format (4 similar errors not shown)

    Solution: Set the values for padding to some dp say 50dp. (dp = density independent pixels)

  4. Issue: Error during Sync: EOF

    Solution: Restart your AVD (Android Virtual Device)

  5. Issue: CPU acceleration status: HAXM must be updated (version 1.1.4 < 6.0.1)

    Solution:
    - Uninstall Intel HAXM from SDK Manager
    - Re-install Intel HAXM
    - Go to location- C:\Users\my_user_name\AppData\Local\Android\sdk\extras\intel\Hardware_Accelerated_Execution_Manager
    - Run intelhaxm-android.exe
    - Run the emulator
  6. Issue: android.database.sqlite.sqliteexception no such table <table_name>

    Solution: This error occurs when an empty database is created in the application with a specific database version. Increment the DATABASE_VERSION by 1 and run the app.


Oracle SaaS: Publishing a List of Values Source for ESS Job parameters

This post describes about how you can publish a List of Value source in Oracle SaaS. This is primarily done to define an LOV for an ESS job...