Skip to main content

Posts

Showing posts from 2017

Android ADB over WiFi without ROOT

Debugging Android application via usb cable connected is difficult, since the cable disconnected every time in my case.

However after searching I found the way to debug the app over wifi on non rooted devices.

#First connect the device to pc and run on terminal

adb devices -l

It will show list of all the connected devices.Ensure your device is visible

#Now run
adb tcpip 5555

set port to any you want

#Now run
adb connect :5555

eg : adb connect 192.168.1.100:5555
To view your phone IP :
Open Settings -> About Phone -> Status -> IP address

# Now remove your usb cable and again run adb devices -l

 your device should be visible

#Now debug from android studio without cable


Android Recycler View Tutorial : Part 2



In part 1 we created recycler view without any model or view holder. In this part we will create data model and a view holder and bind both these to the recycler view.

Previous part : http://www.androidlearner.com/2017/07/android-recycler-view-tutorial.html



Now lets first create a simple data model: DummyModel.java
This class does nothing special it just generate some dummy data.


publicclassDummyModel{//text String textData ="not set yet !!";publicDummyModel(){}/** * constructor to set the dummy text * @param data */publicDummyModel(String data){ textData = data;}staticpublic List<DummyModel>getDummyModel(int length){ List<DummyModel> dummyModelsList =new ArrayList<>();for(int i =0; i < length; i++){ dummyModelsList.add(new DummyModel("This is the model "+i));}return dummyModelsList;}/** * just a setter method !Not used! * @param text */publicvoidsetText(String text){this.textDa…

React Native

React Native : this is the thing which I have been looking for. I want to create my app fast. At first I use rhino with android to keep my app flexible.
However React Native does all this for you, If you haven't heard about react native it is the open source framework for creating app and deploy to multiple platform.
It is more than hybrid apps because it don't use web view it uses bridge to render native component.

Even getting started is very easy no need for android studio.
I am writing this post for windows platform.

#1 first Download the nodejs , Download the latest nodejs , Install it.

#2 open cmd and type node to ensure all thing is running fine.

#3 Now during writing of this post React Native don't work fine with npm5 so you need to downgrade it to npm4 ,

#4 So run cmd and type 'npm install -g npm@4' this will install npm 4

# now lets start with react native app.

# in cmd run


npm install -g create-react-native-app create-react-native-app AwesomeProject cd …

Android Recycler View Tutorial


In Android there is the need when you need to display a list of data or simply data that get generated at run-time. Rather than creating your own layout inflator. Android provide Recycler View, there is also a listview which was provided to show data.

After after many experiments with Recycler View here is the tutorial for it. Hope it will be use full to someone.I assume if you are reading this then you know how to add activity in the android studio.

I have divided the article into several parts. Here is the First part.

Part 2 : http://www.androidlearner.com/2017/11/android-recycler-view-tutorial-part-2.html

Here is the video of it :




# First Create an Android Project. #Compiling the required library Open your build.gradle file for (module:app) level
add line compile 'com.android.support:recyclerview-v7:25.3.1' in the dependencies section.
this will download recycler view dependencies in the project.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15dependencies{compilefile…

Android Hello world Application

Android Hello World Application .

Test video.


Android Parsing JSON



When developing application at some of time you need to communicate with web service for data exchange. If your communication uses JOSN(JavaScript Object Notation) for data transfer. You may start finding the easiest library available for the JSON however there are plenty of library for JSON library for JAVA.
The one which I found suitable for my need is :
JSON-java License : MIT
Author : Sean Leary

In this article I will share how to parse JSON using JSON-java in android however the snippet is not limited to android only Getting Started
1. Download the library from : https://github.com/stleary/JSON-java
    download the source as ZIP from the github

2. Extract the Files from the zip
3. Open Android-Studio
4. Right click the Java folder navigate to New->Package

5. Select the destination directory as main\java , click on OK button

6. Enter package name as org.json and click on OK button

7. Now copy all the JSON-java .java from the source folder and copy them to Android-Studio

Android Studio Tips/Tricks

This post simple contain the android studio tricks which I used.

#1 Case insensitive code completion. This is the which I first enable on  the android studio. If you don't remember commands like me than it is for you, by enabling this you can get the required method or anything if you know part of it.

a.Open Setting from File-> settings
b. Go to code completion and set case sensitive to none c. Now all set you can check the code completion just type and press ctrl+space

#2 Find methods which can be override and implemented. I always want to know which are the methods provided by the base class that can be overridden. To find the methods which can be overridden in android studio.
Just press CTRL+O Now you have all the methods that can be overridden.
#3 Speed up android studio  If android studio lags in your system. I mean only to the GUI. below is the trick which worked for me. Go to settings -> appearance and set theme to windows and disable the animation. (this will give you…

Android How to integrate Admob

In this post I will be describe how can one integrate admob into their application.

For integrating admob you can integrate it as standalone or with firebase.

In this post I will be describing how can you integrate it as standalone.

Things required to display the admob.
1. Your app probably  android (using android studio)
2.  Admob account
3. Your app has permission to access internet.

Android : Change Display To Black And White

Recently I thought to change my display to Black and White. Before finding the app for the same.
I decided to take a peek at the developer option luckily there is an option to change the display color
i.e "Simulate Color space ".

Free Android Template

When developing android apps UI is the main challenge for me to create best user interface.
Here is the list of the resources which will help you to get inspired or UI template to use in your app

1. Dribble
Dribble is the place where you can a lot of inspiring ideas for the interface. Some may provide a template for you to download.



2. invisionapp
After searching a lot for the free template I found  the template by invisionapp. The template provided by the them contain almost every thing needed by you to create your beautiful app.



Android : Currecny Converter

Android Currency Converter :

A simple currency converter.
using : http://fixer.io/ API




Download : Play Store

Android prevent out of memory exception

Well memory out of exception is the common problem for android application. If your application is not memory efficient it will get crashed due to memory exception.

This post does not contain guideline on how to create memory efficient application. This post contain one method which helped my application form getting memory out of exception. i.e to increase the heap size.

Android Studio change package name



Sometime it is needed to change the package of the project.
Below is the easy way which worked for me in android studio.

Android Spinner

Android provide variety of widgets on of them is spinner. Spinner is similar to that of the drop-down list in web it allows user to select a single item from list of items.

Android Transparent status bar

Recently I wanted to get a transparent status bar so that my app background blends smoothly with the status bar . Below method worked



Android remove ActionBar / TitleBar

I want to remove the action bar/ Title bar from my app to make it full screen. Below is the method which helped.



Android Live Wallpaper Tutorial


Hi, at last I was able to create my own live wallpaper " MATRIX RAIN ". 

Download : click here

The matrix rain effect which I am using is the same which I created in canvas.
ref :- http://www.androidlearner.com/2016/09/create-custom-view-in-android-matrix.html
I this post I will describe how I put together the live wallpaper. 



Xamarin : Simple Calculator Tutorial Visual Studio C#

Simple Calculator in Android (Xamarin) using VisualStudio C#In Brief: This article will help you on building a simple calculator in android Xamarin with simple steps using C# Language in Visual Studio. Detail:
Building this simple calculator will let you learn how to work with the Android Buttons, Text View and simple functions. The UI is not so beautiful but is a great way to learn the basic functionalities.

Android : Multiple Button One Listener

Hi you may have ran into problem where you have multiple button in the layout and want want a single listener, so the code become more manageable. Here is how you can manage it.
This below code work for me after several attempt.
So here is what you need. 1.Layout with multiple buttons. 2.create a View.OnClickListenerwhich you will need to attach with the button [Note : I don't know why if the View.OnClickListener is initalised after, assigning the button listener it does not work. View.OnClickListener must be initalised befor assigning it to the button.] 3.Simple switch case which will check which button is clicked.
Below is the code which work for me.

Android : Create a keystore

Generating a certificate or keystore to sign your app using android studio is very easy rather than messing with keytool.

1.Open android studio.

2. Go to Build -> Generate signed apk

Android : Best Game Engine

After using many game engines for creating android game. These are the two which I liked the most