Wednesday, 4 December 2013

Android Kitkat 4.4 features

Android kitkat 4.4 released on October 31st with special features.

1. Low memory support even in 512 Ram. This includes new Api ActivityManager.isLowRamDevice() which let's your app's behaviour to match target device's memory.

2. NFC through Host Card Emulation: Android 4.4 introduces Host card Emulation where it's based on Smart card that uses contactless protocol for transmission.

3.Sms Provider: The new APIs use  new SMS_Deliver intent to allow app developers to route messages through the user’s default messaging app, making the cross-app experience seamless.

4.New Sensor Modes and Connectivity:  Hardware Sensor Batching is a new optimization that dramatically reduce power consumption during ongoing sensor activities.

5. Improved Security: Allows Antivirus Scanner api,control over individual app permissions.  KitKat also improves upon the cryptographic algorithms by adding support for two additional algorithms.

6.Chromium Webview: Android 4.4 includes a completely new implementation of WebView that's based on Chromium.Chromium WebView provides broad support for HTML5, CSS3, and JavaScript. It supports most of the HTML5 features available in Chrome for Android 30. It also brings an updated version of the JavaScript Engine (V8) that delivers dramatically improved JavaScript performance.

7.Screen Recording:  Android 4.4 adds support for screen recording and provides a screen recording utility that lets you start and stop recording on a device that's connected to your Android SDK environment over USB. It's a great new way to create walkthroughs and tutorials for your app, testing materials, marketing videos etc.,If your app plays video or other protected content that you don’t want to be captured by the screen recorder, you can useSurfaceView.setSecure() to mark the content as secure.

Tuesday, 23 July 2013

Volley in android

Volley is a library and also powerful tool that makes networking for Android apps easier and most importantly, faster.It's an alternative of AsyncTask.
It manages the processing and caching of network requests and it saves developers valuable time from writing the same network call/cache code again and again.You can easily load thumbnail images for your ListView from the network in parallel.
Clone the volley project from

 https://github.com/adamrocker/volley

Advantages:
    Volley automatically schedule all network requests. It means that Volley will be taking care of all the network requests your app executes for fetching response or image from web.
    Volley provides transparent disk and memory caching.
    Volley provides powerful cancellation request API. It means that you can cancel a single request or you can set blocks or scopes of requests to cancel.
    Volley provides powerful customization abilities.
    Volley provides Debugging and tracing tools

There are 2 main classes:
1. Request queue
2. Request



private void getServices(String url) {
//        JSONObject reqBody = new JSONObject();
        Map<String,String> params = new HashMap<String,String>();
        if (url.equals(URL_SUCCESS)) {
            try {
                params.put("id", "Demo");
                params.put("output", "json");
                url = addParamsToUrl(url, params);
                volleyRequestQueue = Volley.newRequestQueue(this);
                volleyRequestQueue.add(new JsonObjectRequest(Method.GET, url, null, new MyResponseListener(), new MyErrorListener()));
              
              
            } catch (Exception e) {
                Log.e("ErrorListener", e.getLocalizedMessage());
            }
        } else {
            params.put("level", "1");
            url = addParamsToUrl(url, params);
            volleyRequestQueue = Volley.newRequestQueue(this);
            volleyRequestQueue.add(new JsonObjectRequest(Method.GET, url, null, new MyResponseListener(), new MyErrorListener()));
        }
    }

class MyResponseListener implements Listener<JSONObject> {

        @Override
        public void onResponse(JSONObject response) {
            MainActivity.this.jsonObj = response;
            try {
                JSONObject result = MainActivity.this.jsonObj.getJSONObject("Result");
                String timestamp = result.getString("Timestamp");
                MainActivity.this.resultTxt.setText(new Date(Long.parseLong(timestamp.trim())).toString());
            } catch (Exception e) {
                Log.e("ErrorListener", e.getLocalizedMessage());
            }
        }
    }


and the class error.


class MyErrorListener implements ErrorListener {

        @Override
        public void onErrorResponse(VolleyError error) {
            Log.e("ErrorListener", error.getCause() + "");
            if (error.getCause() != null) {
                Log.e("ErrorListener", error.getLocalizedMessage());
            }
            MainActivity.this.resultTxt.setText(error.toString());
            volleyRequestQueue.cancelAll(this);
        }
    }

Saturday, 8 June 2013

The Way The Life goes..

I am here to say nothing new about Life but just want to color it that i want to share.

It’s my thought how i look Life and how it can be and based on my thoughts which includes for me and not intended to hurt anyone.

Some says Life is dull, looks not colorful,shaded etc., everyone’s Life is like a book,don't skip the page to see what's the end result.Enjoy every moment, sometimes book may contain error correct it,instead don't throw it. Without hot and rain, you can’t see rainbow. Make it so colorful and fly high to touch the sky.

If you are worry, just go to the beach sit and watch the beauty of sea, see the beauty of leaves,nature,singing of birds. Every time sea hits the rock and rise. similarly problem also, destroy those problems and arise and don't withdraw, try as you can.Happiness always surrounds us. utilizing is in our hands.   

Next comes  purest form and meaningful is friendship. All humans cant be same. Every humans may vary.If all characters are equally given by HIM, life will also get bored. Some may reserved, talkative, fighting,angry mood,sad mood etc., but everyone have a good nature,but environment and surroundings make  to change.
Similarly the dear one who shows more angry or irritated just get rid of that place or be silent, more arguments will take more unwanted topics to continue and it will make a gap between the value of friendship.

Making others happy is a gift and similarly should not be responsible for others sorrow. It will hurt them a lot. We may forget but the dear one who got hurt will not say but pain will remain always.Sometimes polite speech and silence is also a best one to defeat a person who hurts you. Don't ever never care what others say or spread gossip about you.just spread a smile.

Once Mother Theresa went in a street and met a stranger who is in upstairs.She looked up and asked sir,will you please donate a fund to the orphanage if you can. Stranger simply splitted on her hands and said, go this what i have. Mother Theresa smiled and said in a polite way that you have given for me, yet there are so many children who still suffering. On hearing this, stranger's heart felt very bad and came from upstairs and hold her legs and asked to forgive him.

No one can't be a perfect! but can be changed with extend. 

Life is to enjoy.In this short and just temporary life, make friends and avoid arguments and angry!!  Cute fights can be done, and it should not get hurt to that person.

If mistake is not on your side, don't worry and be bold on your side and if your mistake is on your side, don't hesitate to say sorry!! 

Ever never change your character for anyone.Be what you are and don't intimate others. One of the main problem arises is confusion between heart and mind. Don't mismatch your love to think in mind and work in heart. Solve it at right time and right place. keep surroundings happy.

Four letter word meaningful and worth.

Love and  live in Life with smile forever!! :)




Do the best what you can

Be the first how should be

Leave the rest if you cant

Keep smiling always...................





Friday, 17 May 2013

Google's New features in location and physical moment.


Google is improving a lot for developer's favour by adding lots of flavour in android.
Three new location based API's- 

Fused Location provider- Fused Location provider basically combines all phone sensors that can detect location and in turn greatly reduces battery consumption when an app such as maps requires specific location.So it combines data from a device cellular radio,gps and wifi to provide more uniform location features in app.

Geofenching- It allows to set up geographical area and then it trigger events when user enter or leave it. It has been there in ios 5.1,now google also going to  provide api.

Activity Recognition-It can figure out, whether you are currently travelling on foot, car or bicycle.

Google's Barra also announced that company is launching Google play game services offering many features IOS users have in Game center along with additional features such as ablility to play corss platform between Android Devices and Web-based games.



Monday, 13 May 2013

Tizen-Samsung Future and not Android

As so many OS are releasing and much competition in mobile world, Samsung +Intel association going to hit a stable release which is so called as Tizen. OS family is based on Linux and it uses HTML 5 scripting language. Tizen released version 2.0 called as Magnolia.

Tizen provides application development tools based on JavaScript libraries JQuery and Jquery Mobile.Since version 2.0 native application framework is also available based on Open Services Platform from Beta platform.

SDK allows developers to use HTML 5 and related web technologies to write application that run on supported devices.

Bada an OS for mobile which open services platform forms native application framework of Tizen 2.0 and later.

Corodova implemtation for tizen is JavaScript wrapper library allowing to build and run Corodova based projects on Tizen.

Tizen is a competitor to Android and IOS but it goes further,Tizen wants to be universal and works on

1.Smartphone
2.Tablet
3.Netbook
4.Vehicles
5.TV


From the official website, you can download SDK https://www.tizen.org/

For Developers tutorial, it's available here. https://source.tizen.org/documentation




Wednesday, 20 March 2013

To pass different activity in tablet and phone android

In this, I am  going to discuss about how to use different activity used  in Tablet and phone. I will show you the structure how it will look. You can use it based on your requirement.

in res->values->bool.xml


<?xml version="1.0" encoding="utf-8"?>
<resources>
    <bool name="isTabletDevice">false</bool>
</resources>


Main.java


         boolean tabletDeviceSize = getResources().getBoolean(R.bool.isTabletDevice);
if (tabletDeviceSize) {



Intent intent = new Intent(Main.this,
B.class);
startActivity(intent);

}

else
{

               Intent intent = new Intent(Main.this,
C.class);
                 startActivity(intent);

}
Happy coding..


Thursday, 3 January 2013

Blackberry beginning tutorial

Well If you are familiar with java, then you can create Blackberry programming.

Click here

https://developer.blackberry.com/java/ to download blackberry sdk 7.1

Then you will be redirected to download page,

http://swdownloads.blackberry.com/Downloads/contactFormPreload.do?code=00EC53C4682D36F5C4359F4AE7BD7BA1&dl=FF6622A42D684A5F18B53B8D94C9BE98&check1=A

Download and install it.

Your eclipse will start

Click File->New ->Blackberry Project

Enter Project name and click Finish.

In package explorer, you will find package.Inside the package you will find two class file. MyScreen.java and MyApp.java.You can rename it as your choice.

MyScreen.java is the "Application" screen and MyApp.java is "MainScreen" application class.

Let's proceed in programming..

MyScreen.java:


Import net.rim.device.api.system.ApplicationManager;

Import net.rim.device.api.ui.UiApplication;

Public class MyScreen extends UiApplication
{

Public static void main(String args[])
{

//new Instance of application

Launcher lr=new Launcher();

lr.enterEventDispatcher();

Private Launcher()
{

This.pushScreen(new MyApp() );

}

}


MyApp.java


Import net.rim.device.api.ui.component.LabelField;

Import net.rim.device.api.ui.container.MainScreen;

Public class MyApp extends MainScreen

{

//Inside the constructor,labelfield been used.
Public MyApp()

{

//I am creating a labelfield that will display in screen
LabelField lf=new LabelField();

//set the text that you want in label field.
lf.setText(“Hello world”);

//add the label field in mainscreen
this.add( lf );

}

}

To run the application. run->run project->Blackberry simulator