Skip to main content

Posts

Showing posts from July, 2013

Introduction and Example of Eventbus in Android.

EventBus is a library of Greenbot . This is very simple for all users how to implement and its basic use. Here I will also share examples for better understanding. What is EventBus? EventBus is subscribed/publish event bus to communication between components with limited lines of code, in short, its bus for events transfers the data between one activity(class) to another to reflect the changes based on our needs. That makes the data exchange between components like Activity, Fragment, Services, and any kind of backgrounds threads pretty easy. EventBus can handle the threading for us: events can be posted in threads different from the posting thread. Common use can be dealing with UI changes. In Android, UI changes must be done in the Main(UI) thread. In other words, networking or more time-consuming task cannot be handled in the Main thread, for that we must use AsyncTask or Handler to make it more smooth. Now we have one more options use EventBus to change the UI po

Get the Current Latitude Longitude using GPS

As per new Google Map API. They have changed in MAP integration as well as Update the Google Play Service to fetch Current latitude and longitude using GPS/Wi-fi. The location APIs make it easy for you to build location-aware applications. For that first you need to setup the Google Play Service through your SDK Setup Google Play Services SDK A compatible Android device that runs Android 2.2 or higher and includes Google Play Store. The Android emulator with an AVD that runs the Google APIs platform based on Android 4.2.2 or higher. Install the Google Play Services SDK Launch the SDK Manager.  Install the Google Play services SDK. ( <android-sdk>/extras/google/google_play_services/ .) Install a compatible version of the Google APIs platform. Make a copy of the Google Play services library project. (Copy the library project at <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/)   [Get Latitu

Disable Force Stop in Android

I have worked since 1 week on how to disable the FORCE STOP button in Manage Application in Android. And I was able to disable the Force Stop and Uninstall button in Manage Application. For that you need to make your application as Device Administrator. Android has add this kind of feature from Android 2.2 version. This feature is for Security reason with different option. Set Minimum Password Strength, Data Wipe, Force Lock,  Reset Password and so on. We set our application as Device Administrator to change above features. For more info and advance example you can check your android-sdk path (>= android-8). \samples\android-[>=8]\ApiDemos\src\com\example\android\apis\app\DeviceAdminSample.java See the below screen shots which shows how to activate the application and disable force stop button. [Active device adminstrator] [Disable the Force Stop and Uninstall button] Follow the below steps to disable the FORCE STOP button. 1. Create one cl

Find Unused Resource From Android

Find Unused resource from Android Application: Today I am going to share one tool which help you to remove Unused Resources from the Android Application. I hope you guys like this. We all know that once we start our development, at starting stage we enthusiasm about our logic and codes and we always try to make proper code with good arrangement. But when day passed away we adding so many new things which may be unused or else we never used that because its for our demo purpose only. That tools is created by other person but I am just share that things with you guys. And I am giving full credit to that person who developed this tool. Really it help a lot while we developed the application. Resource means images (drawable), text (string.xml, style.xml), id (used by layouts) etc... Android Unused Resources is a Java application that will scan your project for unused resources. Unused resources needlessly take up space, increase the build time, and clutter the IDE's

Android Client Connected with Socket Server

I hope this will help you for how to start communication between Socket Server (Desktop Chat Server Application) and Mobile Application (Android Socket Client). This application simply look like as chat application. You can add your idea and innovation to make very useful application. Follow below steps to run application: Use custom port and define same port in both application (i.e. Port No: 5657 ) Define computer IP Address in Android Client Application. (i.e. 192.168.1.x) . If you want to run this application in real device, then you can't connect with Desktop Socket Server. For that you need to upload runnable jar file in specific server and then you can use that server IP Address. First start Socket Server Application using Start button. Now you can start Android application. Just Enjoy it !!! Here I give you screen shot for communication between both application. [Socket Server (Desktop Application)] [Socket Client (Android Application)]