Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

October 15, 2018

Android Error: Failed to resolve: com.google.firebase

[Android Studio]

Issue:

I updated gradle to 4.4 in my Android app and added below firebase libraries to my app level build.gradle file

implementation 'com.google.firebase:firebase-core:16.0.0'


but while building the project, got the below error

Failed to resolve: com.google.firebase:firebase-core:16.0.0


Solution:
This is a maven issue. This issue is resolved after adding google() to repositories of allporjects in project level build.gradle file. Now the json looks like below.

allprojects {
    repositories {
        google()
        jcenter()
    }
}

May 18, 2017

Error:The number of method references in a .dex file cannot exceed 64K. Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html

While building an android app in Android Studio, I got the below error and the build was failed.

Error: The number of method references in a .dex file cannot exceed 64K. Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html

The solution to avoid this error is, add the property "multiDexEnabled true" under defaultConfig in app's build.graddle file. It will look like below.

android {
    compileSdkVersion 23
    buildToolsVersion "24.0.0"

    defaultConfig {
        applicationId "com.sonuappz.app"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }


Update:

The above solution works for the issue but the root cause is because of multiple libraries added in the app may have same references inside. Try to identify what library exactly needed for the app and remove the extras. If still the issue occurs, above is the solution for it.

October 19, 2016

WindowManager: android.view.WindowLeaked: Activity has leaked window

While developing an android mobile app, I received this error.
In the mobile app, on click of back button, a dialog will be opened with few buttons including "Exit". On click of exit, I have given (Activity context).finish(); but it is throwing the below error.


WindowManager: android.view.WindowLeaked: Activity <app package> has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{45500950 V.E..... R....... 0,0-640,929} that was originally added here
at android.view.ViewRootImpl.<init>(ViewRootImpl.java:368)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:252)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
at android.app.Dialog.show(Dialog.java:286)
at android.app.Activity.onKeyUp(Activity.java:2204)
at android.view.KeyEvent.dispatch(KeyEvent.java:2664)
at android.app.Activity.dispatchKeyEvent(Activity.java:2434)



This error occurred due to improper closing of the dialog box before exiting the app. So, the solution I found is to dismiss the dialog box before calling finish() method.

September 5, 2016

Social All In One - One app solution for all your social network activities

I have developed another android app named as "Social All In One" which is a one app solution for all your social activities. No need to install each app like Facebook, Twitter, Linkedin, Pinterest and Instagram etc. This app supports all popular social networking sites.

It will become the primary Social Hub on your phone.

This app supports social networks including Facebook, Twitter, Linkedin, Google+, Instagram, Badoo, Disqus, Flickr, My life, Hi5, Reddit, Vine, VK, Wayn, xing, We heart it, Livejournal, My heritage and more.

Click here for more details.


July 28, 2016

Reverse 2048

Reverse 2048  - A new android app from me.

This is a fun, addictive and a puzzle board game. It is a cool variant of traditional 2048 puzzle game.

The challenge is to reach from the #2048 tile to #1 tile. When tile with number 1 is created, the player wins the game.

Click here for more details of the app.


January 7, 2016

Typing Hero - Challenge your typing skills

I developed another android app "Typing Hero" to test and challenge your typing skills.

Typing Hero is a fun and learn app where you can increase your typing skills and also have fun by challenging each level with your friends in the app.

Typing Hero has different types of typing difficulties like Beginner, Medium, Hard and Harder. Each of these difficulties has several levels except Harder. Harder has only one level which gives more difficult lines to type every time which makes you expert in typing.

Click here to know more about the app.

Click here to download the app from play store.

To know other apps developed by me, visit Sonu Appz.




September 11, 2015

ABC for kids - Android app for Kids

I have developed another android app for kids to learn basics like alphabets, numbers, colors and shapes etc.

Playing is the best way to learn and remember.

This app also provides simple play options which help kids to play around the basics they learnt.

Click here to know more about the app.

Click here to download the app from Google Playstore.

Have fun with “ABC for kids”!!!

To know others apps developed by me, visit Sonu Appz.



September 10, 2015

Search App

I have developed another android app, named it as "Search App". It is very simple app.

A single point to search any app on your device.

You may have many apps on your device. You may also maintain groups on your device for those apps. When you want to open an app, you have to travel till that app and click on it. If you have 5 screens on the home and if your app is on the 5th screen, you have to navigate to the 5th screen and open the app.

Search app will be single point to search and open any app on your device.


Just type few letters of your app name in the search field and your app will be filtered.
Just tap on it, your app will be opened.

 Search App

April 8, 2015

Run Android Apps on your Mac or PC

Do you have Chrome on your Mac or PC? Then you can run android apps on your Mac or PC.
Google has come up with App Runtime for Chrome (ARC).

Pre-requisites:
  • You need Chrome browser for sure to start with it
  • apk file of the app  you wanted to install 

Procedure:

      Below is the procedure to setup and install the apk file.
  • Install the "ARC Welder" extension on the chrome. Click here to install it.
  • After installation is done, you can see an icon with the label ARC Welder on the chrome apps tray 

  • Click on the icon. A new window will be opened as shown below

  • Click on "Add your APK" and choose the path of your apk file
  • It will show the window like below

  • Choose the orientation, form factor and click on the button LaunchApp
  • Now the app will be launched in a new window
  • You can also download the chrome package for the app by clicking the button DownloadZip on the above screen

References:

March 25, 2015

Fun Facts

Do you want to improve your knowledge?
Do you want to impress friends with some facts?
Then Fun Facts app is for you.
"Fun Facts" is an android app shows some quotes which are funny but real facts.
Install the app @ https://play.google.com/store/apps/details?id=com.sonuappz.funfacts

February 2, 2015

AlarmManager

If you want to run a piece of code in the background at certain intervals, then AlarmManager is the class helps us to do this. It will wake up the device on the given intervals and invokes the Receiver class where we should write our code to run in the background. Below code snippet explains how to implement AlarmManager.

Intent notificationIntent = new Intent(context, LoadData.class);
notificationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent   pendingIntentSyncDB;= PendingIntent.getBroadcast(context, 0,
                                notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);

AlarmManager alarmManager = (AlarmManager)  getSystemService(Context.ALARM_SERVICE);
int intervalTime = 1000 * 60 * 5 ;// 5min
alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(),  intervalTime, pendingIntentSyncDB);

In the above snippet, LoadData is a broadcast receiver class which executes the background code. AlarmManager invokes the LoadData for every 5mins.

January 29, 2015

Board Puzzles

This is extension to my previous post BOARD PUZZLES.

An update to my app Board Puzzles is available in the Google Play store.

The same can be available at the below link.

https://play.google.com/store/apps/details?id=com.sonuappz.numbergame

Please install/update the app and have fun.


Visit my apps blog : http://sonuappz.blogspot.com

January 19, 2015

BOARD PUZZLES

I have developed an android app named “Board Puzzles” which is available in Play store now.

It is a board puzzle gaming app which has options to choose number or alphabets to display on the board. 
It is a puzzle gaming app where user has to arrange the numbers or alphabets on the board from least to greatest.

This app supports both android phones and tablets, and also supports 8038 types of devices.

Please visit the below link and install the app on your android devices.


Rate the app if you like it. Have fun !!

Click here to visit Sonu Appz (name for my apps account) blog.



January 16, 2015

android.os.NetworkOnMainThreadException

android.os.NetworkOnMainThreadException  is an android runtime exception which occurs when you are trying to run any network or IO related operations from main activity. Android doesn't support to run IO operations directly on the main activity. 

So to avoid this exception, use a thread to do these operations or you can also use AsyncTask class which helps you to run the code in the background.

December 11, 2014

R.java file is missing in android application

While working with an android application in eclipse, some times the R.java file may missed out from the application. This is because the XML files in the app may have errors. So, resolve those errors in the XML files and then clean the project. Now the R.java file will be automatically created.

November 20, 2014

android.content.ActivityNotFoundException: Unable to find explicit activity class

I am developing an android application. On the home screen, it has a button, on click of this an activity should be displayed. While testing the app, on click of the button, the app is giving the below error and the app got terminated.

E/AndroidRuntime(Number): java.lang.RuntimeException: Unable to resume activity {app package}: android.content.ActivityNotFoundException: Unable to find explicit activity class {activity class}; have you declared this activity in your AndroidManifest.xml?

The solution for this is,

Every activity created in android application should be configured in AndroidManifest.xml of the app. To do so, open AndroidManifest.xml and goto Application tab. Under Application Nodes, add all the activities. 

September 10, 2014

Install apk file in Android emulator

In the command prompt, go to the path of bin folder under android sdk and run the below command.


adb install <apk file>