Tuesday 20 December 2016

Chart in Android Application

Charts are a great tool for communicating information visually. Using "MPAndroidChart" you can design and share your own charts through Android application.







Tuesday 6 December 2016

Requesting Permissions at Run Time



Normal and Dangerous Permissions


System permissions are divided into several protection levels. The two most important protection levels to know about are normal and dangerous permissions:

Normal permissions cover areas where your app needs to access data or resources outside the app's sandbox, but where there's very little risk to the user's privacy or the operation of other apps. For example, permission to set the time zone is a normal permission. If an app declares that it needs a normal permission, the system automatically grants the permission to the app. For a full listing of the current normal permissions, see Normal permissions.
Dangerous permissions cover areas where the app wants data or resources that involve the user's private information, or could potentially affect the user's stored data or the operation of other apps. For example, the ability to read the user's contacts is a dangerous permission. If an app declares that it needs a dangerous permission, the user has to explicitly grant the permission to the app




   

Step 1 :


You’ll also need to declare Permissions in your AndroidManifest.xml file. There’s no change here. Whatever permissions your app has always needed should be declared in your AndroidManifest.xml file with the uses-permission tag. 



Step 2 : 


Verify Permissions before calling APIs
You have to actually request and check if the permission was granted by user to use.
So permissions in manifest file will only work for api below 21.
Check this code for a snippet of how permissions are requested in api23 


Here’s an example:👆


Thursday 1 December 2016

Text To Speech & Speech to Text





Text To Speech

It is a great piece of technology that was developed to help individuals with visual impairments. However, device manufacturers these days enable text-to-speech Android that allows books to be read out loud and new languages to be learned.
Android text to voice was introduced when Android 4.2.2 Jelly Bean was launched with a more conversational capability so that users are able to have a familiar human-like interaction.
At the moment, there are not many Android texts to speech app available in the market that fully utilizes Google text speech technology. In this article, we will guide you on how to use Google text-to-speech on Android.

Speech to Text

Android comes with an inbuilt feature speech to text through which you can provide speech input to your app. With this you can add some of the cool features to your app like adding voice navigation (Helpful when you are targeting disabled people), filling a form with voice input etc.
In the background how voice input works is, the speech input will be streamed to a server, on the server voice will be converted to text and finally text will be sent back to our app.

Combination of Text To Speech & Speech to Text


Here application has one Question with its multiple answers as options.   When launch time, application will read (speak) the question as well as its answers list by default, will wait for user response.  Based on user response (voice input) system will match with existing answer list. If the answer is match with any of the answer, system will continue to the next questions or next level of process. Else it will ask to the user to give correct input till its match with existing answer list. 


For Sample - Click Here  ☝


Monday 26 September 2016

Microsoft Translator API Integration

Microsoft Translator is a hosted service, accessed via an API that provides language translation.
It can be used to build Android Applications where you need language translation.
You need to get started with using the Translator API to translate content by signing up for the service, registering an application, and getting your Client ID and Client secret.





  1. Signing up for Microsoft Translator and getting your credentials.
  2. Get an account on Windows Azure Marketplace.
  3. The Microsoft Translator API is accessible through Microsoft Windows Azure Marketplace.

 You can see it here:
 https://datamarket.azure.com/home/.


To begin developing using the Microsoft Translator API, you need to do the following:


  1. Register for an account on Windows Azure Marketplace.
  2. If you already have an account, you can use it, but it’s recommended that you follow through these steps to ensure that you configure the service correctly
  3. Sign up for the Microsoft Translator API using your registered account.
  4. Register your application on Windows Azure Marketplace.
  5. Get the Client ID and Client Secret for your registered application.
  6. The following instructions will show you how to do this. When you’ve completed them, you’ll be ready to start coding.

Wednesday 14 September 2016

Socket to execute Android Commands :-)



In this tutorial we are going to see how to use Sockets in Android Applications. 
In Android, sockets work exactly as they do in Java SE. In this example we are going to see how to Restart  an android Application  from Windows/Mac using device IP & Port no.  
Even Application is not running in Android Tablet device , can Execute/Launch using this method.










Thursday 25 August 2016

Custom shape image-view in android using canvas


Article for custom shape image-view in android using canvas. 

There is no library needed, using canvas you can make any type of shape with simple java code



Click here to get the method ;-)








Thursday 14 July 2016

Customizing Radio Group In Android



In Android, you can use “android.widget.RadioButton” class to render radio button, and those radio buttons are usually grouped by android.widget.RadioGroup. If RadioButtons are in group, when one RadioButton within a group is selected, all others are automatically deselected.




Customizing Radio Button In Android
Custom Radio Buttons
In android we can customize  the default Radio Buttons. Default Radio Buttons are small and also not attractive, By using customized Radio Buttons we can design more attractive and better user interface.

To customize Radio Buttons we need to have two drawables
1:  when radio button is selected.
2:  when radio button is not selected.

In this example I have  used these two drawables for selected and not selected state.




Click here to access Resource file

Sunday 19 June 2016

Data Encryption/Decryption



“Encryption works best if it is ubiquitous and automatic. It should be enabled for everything by default, not a feature you only turn on when you’re doing something you consider worth protecting.”

-Bruce Schneier, Cryptographer, Privacy and Security Specialist







Encryption enhances the security of a message or file by scrambling the content. To encrypt a message, you need the right key, and you need the right key to decrypt it as well.It is the most effective way to hide communication via encoded information where the sender and the recipient hold the key to decipher data. The concept isn't that different from children who come up with secret code words and other discreet ways to communicate, where only they can be able to understand the message. Encryption is like sending secret messages between parties—if someone tries to pry without the proper keys, they won't be able to understand the message.


There are two methods of encryption: symmetric and asymmetric encryption. Symmetric encryption, also known as secret key encryption, pertains to the sender and the recipient holding the same keys to encrypt and decrypt a message. Asymmetric encryption, or public key encryption uses what is called a key pair—a public key for encrypting a message, and a private key to decrypt it.


Click here to get methods ;-)


Sunday 12 June 2016

How to hide status bar & Notification bar permanently form an activity !!!




Smartphone notifications are pretty useful, there's no denying that. They make it hard to miss an important event, such as an upcoming appointment in one's calendar or the arrival of a new email in their priority inbox. But when abused, notifications can be quite annoying. Android users would surely agree with that – it is a common practice among developers to have their games pushing notifications reminding the user that they have skipped a day without playing or that they're about to miss on an in-app purchase discount. You know, stuff that nobody really cares about. Thankfully, disabling these annoying Android notifications is an easy job, requiring no hacking whatsoever.


Click here to get solution  ;)

https://github.com/nithinchalakkal





Wednesday 27 April 2016

Android Application Locker - :-)




Setting a lock code on your smartphone is highly recommended to protect your personal information, but sometimes a lock code can be a bit inconvenient.

What if you could do away with the device lock code, instead locking only the apps you want to keep private? An Android app named App Lock let's you do just that. That's not to say you can't use App Lock in addition to the lock code on your device, adding an extra level of security to your information.

App Lock, preventing unwanted access to any app you deem private.







Thursday 21 April 2016

Function to Copy Application Db To Download Folder






public static void copyAppDbToDownloadFolder() throws IOException {
   try {
       File backupDB = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS), "Database_BK_UP.db"); // for example "my_data_backup.db"
       File currentDB = ctx.getDatabasePath("Estibyan.db"); //databaseName=your current application database name, for example "my_data.db"
       if (currentDB.exists()) {
           FileInputStream fis = new FileInputStream(currentDB);
           FileOutputStream fos = new FileOutputStream(backupDB);
           fos.getChannel().transferFrom(fis.getChannel(), 0, fis.getChannel().size());
           // or fis.getChannel().transferTo(0, fis.getChannel().size(), fos.getChannel());
           fis.close();
           fos.close();
           Log.i("Database successfully", " copied to download folder");
           
       } else Log.i("Copying Database", " fail, database not found");
   } catch (IOException e) {
       Log.d("Copying Database", "fail, reason:", e);
   }
}

Thursday 25 February 2016

Take a Photo from Android Camera and Upload via Base64 :-)


Most of android applications allow you to click image and upload to web. In this post I can explain you how to create application in android which access your mobile camera, click image and upload to server.


This post is very help full for those who are new to android and need to upload image to server.


Service to access web-service data using Rest-full service call

Features of a REST-full Services


Every system uses resources. These resources can be pictures, video files, Web pages, business information, or anything that can be represented in a computer-based system. The purpose of a service is to provide a window to its clients so that they can access these resources. Service architects and developers want this service to be easy to implement, maintainable, extensible, and scalable. A RESTful design promises that and more. In general, RESTful services should have following properties and features,



  • Representations
  • Messages
  • URIs
  • Uniform interface
  • Stateless
  • Links between resources
  • Caching



How to do text writing animation?  In Android Development we do not have the option to use any other custom font in our default Tex...