Friday, August 01, 2014

Java Github Project URL - Kapil Sharma

Java Github Project URL: https://github.com/bornfreesoul/java

On the above URL. I regularly update code example of different types of java application. 

The purpose is to use them in your coding practice or use them as methods in your code if they suits your coding need :) 

Fast learning is all ways mutual sharing of your knowledge :) 

So keep on sharing and keep on leaning new things ;)


Friday, June 27, 2014

Android L Release: Developer Preview Build Installation - Kapil Sharma


Steps for installation of Android L on Nexus 5 and Nexus 7 series devices: 

Step 1: First download the relevant Android L OS file from Google site. (http://developer.android.com/preview/setup-sdk.html)

Step 2: Than open developer options on your Nexus device. These options are hidden. 

So go to Settings > About device and then tap on the build number 7 times. 
Once you have done that, you will find developer options in your Settings menu.

Step 3: Open developer options and make sure USB Debugging is ticked.

Step 4: Check if your computer has the relevant drivers required for Nexus devices. 

If not, download the drivers from here and install. 
(http://developer.android.com/sdk/win-usb.html)

Step 5: Make sure you have ADB and Fastboot Installed. For this, follow the steps from here (http://forum.xda-developers.com/showthread.php?t=2317790)


Step 6: Connect your device to computer and open ADB (it will open in a command window). Type adb reboot bootloader. Your phone will go into recovery mode. 

Check the screen and see that for Bootloader status it shows unlocked.

Step 7: Most likely your device will have the locked bootloader. 

To unlock it, type fastboot oem unlock. Then follow instructions on your phone screen. 
This will unlock bootloader as well as do a factory reset of the device.

Step 8: Disconnect and reconnect your device to PC. 

You may have to go into settings again, reveal developer options and select USB debugging.

Step 9: Unzip the Android L file you had downloaded. Create a new folder with an easy to type name like Android and put all the files in it. Then put this folder into Minimal ADB and Fastboot Folder which is in your computer's program folder.

Step 10: Hold SHIFT key and right click on the Minimal ADB and Fastboot folder. 

From the menu, select "Open Command Window here".

Step 11: With your device connected, type adb reboot bootloader.

Step 12: Navigate (use CD to change directories) to the folder where Android L files are stored.


Step 13: Type flash-all in the command window.

Step 14: If you have done everything right, Android L will be installed on your device. 

It will take up to max 15 minutes though. 

Warning: This is an developer preview build this may contain bugs and leads to device crashes. 

Saturday, September 14, 2013

How to create your first Java code on Eclipse: Class 200

     How to create your first Java code on Eclipse: Class 200

     Double click on Eclipse short-cut icon, mine Eclipse IDE is Juno flavour. 
    
    Click New+ under file menu option then again click on Java project.(Fig. J1) 
     
    Click next after entering Java Project name.(Fig. J2) 

In Java settings page (Fig. J3) just click finished. 
     
    After this the IDE workbench windows (means the windows for writing code opens) now, again right click on “src” folder select “New” and then select “Class” (Fig. J4). 
    
    A New Java “class” file windows opens up, write down the name for that class and click finished. (Fig. J5). 
     
    Now the user named class file open up. (Fig. J6
    
    Now write down the code, which shared in the Fig. J7.  
     
    And now, you can see your output/result in the eclipse-ide console window. 

Friday, May 17, 2013

My Android Reboot Class: 101


Class: 101

First class and hands on details, how I try to make my first real application. 

What I learn, I will share, each bits and bytes with you all, so that a collective learning can be attained in this first session or in upcoming future sessions. 

This lesson is for the first timers, so if you are advance Android experts you can further skip this lesson or future lessons.

So, this how I started my first Android learning curve.................... 

Prerequisite for this session: 

1.) Windows(XP/7/8) Or Ubuntu (10-12.04 LTS) machines. 
2.) Eclipse IDE 
     (http://www.eclipse.org/downloads/packages/eclipse-classic-422/junosr2)
3.) Android SDK (http://developer.android.com/sdk/index.html#download)
4.) ADT-Plugin for Eclipse to integrate Android feature in IDE.   
    (http://developer.android.com/tools/sdk/eclipse-adt.html)
5.) Latest SDK tools and platforms using Android SDK.

Note: 
Don't worry, if you don't know, how to install and configure the above prerequisite. I will share each details with you in upcoming classes :) 





Thursday, March 28, 2013

Nexus 5 (Rumored):



Nexus 5: 




Hardware specs: 

Screen: 5-inch 1080p display.

Processor: Snapdragon 600 CPU processor.
Battery: 3,140mAh. 
RAM: 2.5 or 3GB.
Camera: 9MP (CCD Nikon)

OR 


Screen: 5.2-inch IPS display.

Battery: 2,900mAh. 
RAM: 3GB. 
Processor: Qualcomm Snapdragon 800 at 2.1GHz.
Camera: 16MP.

Monday, December 10, 2012

Android SDK on Eclipse (Ubuntu-Linux)


Android SDK Tools > Rev. 20
Android SDK Platform-tools > Rev. 12

SDK Plaform > API 16

Monday, August 13, 2012

ADT setup on Eclipse IDE on Ubuntu


Custom plugin for the Eclipse IDE, called Android Development Tools (ADT). 

If you need to install Eclipse, you can download it from http://www.eclipse.org/downloads/. 
Android recommend the "Eclipse Classic" version. 

Download the ADT Plugin
Start Eclipse, then select Help > Install New Software....Click Add, in the top-right corner.
In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the 

Location: https://dl-ssl.google.com/android/eclipse/    >>  (Click OK)

Note: If you have trouble acquiring the plugin, try using "http" in the Location URL, instead of "https" (https is preferred for security reasons).In the Available Software dialog, select the checkbox next to Developer Tools and click Next. In the next window, you'll see a list of the tools to be downloaded. Click Next.
Read and accept the license agreements, then click Finish.

Note: If you get a security warning saying that the authenticity or validity of the software can't be established, click OK.When the installation completes, restart Eclipse.

Configure the ADT Plugin
After you've installed ADT and restarted Eclipse, you must specify the location of your Android SDK directory:

Select Window > Preferences... to open the Preferences panel (on Mac OS X, select Eclipse > Preferences). Select Android from the left panel.

You may see a dialog asking whether you want to send usage statistics to Google. If so, make your choice and click Proceed. For the SDK Location in the main panel, click Browse... and locate your downloaded Android SDK directory (such as android-sdk-windows). Click Apply, then OK.

If you haven't encountered any errors, you're done setting up ADT and can continue to the next step of the SDK installation.

Source: http://developer.android.com/guide/faq/troubleshooting.html#installeclipsecomponents

Android on Linux (Ubuntu)


First download this package a .tgz. Unpack it to a safe location on your Ubuntu machine.

Package Name: Linux (i386) >> android-sdk_r20.0.1-linux.tgz

By default, the SDK files are unpacked into a directory named android-sdk-linux_x86.

Make a note of the name and location of the SDK directory on your system—you will need to refer to the SDK directory later, when setting up the ADT plugin and when using the SDK tools from the command line.

Troubleshooting Ubuntu If you need help installing and configuring Java on your development machine, you might find these resources helpful:o https://help.ubuntu.com/community/Javao https://help.ubuntu.com/community/JavaInstallation


  • Here are the steps to install Java and Eclipse, prior to installing the Android SDK and ADT Plugin.


1. If you are running a 64-bit distribution on your development machine, you need to install the   
    ia32-libs package using apt-get::apt-get install ia32-libs
2. Next, install Java: apt-get install sun-java6-jdk
3. The Ubuntu package manager does not currently offer an Eclipse 3.6 version for download,  
     so we recommend that you download  Eclipse from eclipse.org (http://www.eclipse.org/ 
     downloads/). A Java or RCP version of Eclipse is recommended.
4. Follow the steps given in previous sections to install the SDK and the ADT plugin.

The Android SDK separates tools, platforms, and other components into packages you can download using the Android SDK Manager. The original SDK package you've downloaded includes only the SDK Tools. To develop an Android app, you also need to download at least one Android platform and the latest SDK Platform-tools. You can update and install SDK packages at any time using the Android SDK Manager. If you've used the Windows installer to install the SDK tools, you should already have the Android SDK Manager open. Otherwise, you can launch the Android SDK Manager in one of the following way.


  • On Mac or Linux, open a terminal and navigate to the tools/ directory in the Android SDK, then execute android sdk.


When you open the Android SDK Manager, it automatically selects a set of recommended packages. Simply click Install to install the recommended packages. The Android SDK Manager installs the selected packages into your Android SDK environment. 

The following sections describe some of the available SDK packages and more about which ones we recommend you install.Once you have installed your packages, continue to the next page.























Figure Alpha. The Android SDK Manager shows the SDK packages that are available, already installed, or for which an update is available.

Source: http://developer.android.com/sdk/installing/index.html

Saturday, June 30, 2012

JellyBeans, 4.1, r20 SDK is out :)



JellyBeans AKA 4.1, r20 SDK is out for users.


API level is 16, yesterday I configure it on my Ubuntu machine running Eclipse IDE.


For this upgrade I need to update my SDK (I had r18) previously changed to r20 + updation of ADT zip 


And after that the Android Emulator start running on my machine. 


I will update the screen-shot next week :)

JellyBeans SDK: http://developer.android.com/sdk/index.html

Thursday, May 31, 2012

New Session Track 1 (Android Basics)



How to install Android SDK on Ubuntu 11:


1.) Download this SDK for Linux (Ubuntu) http://dl.google.com/android/android-sdk_r18-linux.tgz
2.) Un-zip or extract in a folder ADK or any name.
3.) In this folder (e.g android-sdk-linux) go to "tools" and than look for " android " script.
4.) Double click on that and select "Run in Terminal"
5.) this leads to a android software downloader kind of tool UI
6.) Select SDK tools, Goolge API as main and rest on your own selection if you have some idea.
7.) That's it update the selection by selecting "Install", so here we are with updated Android SDK on Ubuntu 11 (Linux) OS. 


Soon add screen-shots for better understanding, till than happy Android hunting :)     

Wednesday, April 18, 2012

Android NDK


The Android NDK is a companion tool to the Android SDK that lets you build performance-critical portions of your apps in native code programming in C or C++. 


For overview of Native Development Kit (C, C++) :
 
The native system headers, libraries that will be supported in the Android platform, starting from Android 1.5 onwards.
 

Tuesday, March 06, 2012


Mockito: 
 
It lets you write beautiful tests with clean & simple API.

Mockito tests are very readable and they produce clean verification errors.


Some features:
1.) Mocks concrete classes as well as interfaces
2.) Little annotation syntax sugar - @Mock
3.) Verification errors are clean - click on stack trace to see failed verification in test; click on exception's cause to navigate to actual interaction in code. Stack trace is always clean.
4.) Allows flexible verification in order (e.g: verify in order what you want, not every single interaction)
5.) Supports exact-number-of-times and at-least-once verification
6.) Flexible verification or stubbing using argument matchers (anyObject(), anyString() or refEq() for reflection-based equality matching)
7.) Allows creating custom argument matchers or using existing hamcrest matchers

Distribution:
Single-jar distribution includes cglib, objenesis and source code
Zip distribution contains all jars, javadoc and source code


Unit Test Your Android Application (with Robolectric)

Thursday, March 01, 2012


Android Testing Framework Overview:


 

Working with Android Test Projects:



The testing framework has these key features:
  • Android test suites are based on JUnit. You can use plain JUnit to test a class that doesn't call the Android API, or Android's JUnit extensions to test Android components. If you're new to Android testing, you can start with general-purpose test case classes such as AndroidTestCase and then go on to use more sophisticated classes.  
  • The Android JUnit extensions provide component-specific test case classes. These classes provide helper methods for creating mock objects and methods that help you control the lifecycle of a component.
  • Test suites are contained in test packages that are similar to main application packages, so you don't need to learn a new set of tools or techniques for designing and building tests.
  • The SDK tools for building and tests are available in Eclipse with ADT, and also in command-line form for use with other IDES. These tools get information from the project of the application under test and use this information to automatically create the build files, manifest file, and directory structure for the test package.
  • The SDK also provides monkeyrunner, an API testing devices with Python programs, and UI/Application Exerciser Monkey, a command-line tool for stress-testing UIs by sending pseudo-random events to a device.