Send $http post/get request using ajax or angularjs

If you are using ajax to send form data (especially if you have enctype=”multipart/form-data” for file upload) then use following script to send your request.

For angular js (with in the controller)

            In server side, to accept post request (for both ajax/angularjs)

Continue reading

Git Introduction

Git is primarily used for source-code management in software development, but it can be used to keep track of changes in any set of files. Git was created by Linus Torvalds in 2005 for development of the Linux kernel, with other kernel developers contributing to its initial development. Git Basics Git uses Snapshots, Not Differences […]

Continue reading

Version Control System

When people screw up their life, they call God for help. When developer screws things up, They call VCS for help.   What is Version Control System(VCS)? Version Control is a system/tool that tracks changes to a file or set of files over time. Why should one use VCS? It allows one to track back […]

Continue reading

Simple Social Share Button

This post explains a simple way to share the post on social media without any API. Just you following Urls url should be in Url Encoded format: Example: Url:   https://www.codebucket.in/ Url Encode : https%3A%2F%2Fwww.codebucket.in%2F Encoding can be easily done by various method:- Online: -https://www.urlencoder.org/ Php:- use urlencode() JavaScript:- use encodeURI() Twitter

Example:

Output: […]

Continue reading

Dig Deeper into Service, Async Task & Thread

What is the difference between Service, Async Task & Thread? Service A Service is an application component that can perform long-running operations in the background and does not provide a user interface. Services can run the even if the activity that triggers it, is no longer active. When to use? For the task which does […]

Continue reading

Glide vs. Picasso

While comparing the sizes of the .jar file of both the libraries, Glide is almost 3.5 times larger than Picasso in size.   both libraries have almost same syntax if you want to simply load the image from the URL and display them into the image view.   One thing in which Glide dominates is, […]

Continue reading

Comparison of Android networking libraries

According to various benchmarks on various parameter Retrofit is prefered over Volley     https://stackoverflow.com/questions/16902716/comparison-of-android-networking-libraries-okhttp-retrofit-and-volley https://stackoverflow.com/questions/42106170/android-volley-vs-retrofit-which-is-better-and-why?noredirect=1&lq=1 https://medium.com/@mohitkumar0571/fast-android-networking-vs-retrofit-vs-volley-32ca4a0e4030 http://instructure.github.io/blog/2013/12/09/volley-vs-retrofit/ https://stackoverflow.com/questions/25346813/google-volley-vs-android-async-http https://medium.com/@sotti/android-networking-ii-okhttp-retrofit-moshi-and-picasso-c381f6c0efd8 https://stackoverflow.com/questions/25739620/why-should-i-use-okhttp-instead-of-android-httpclient-and-asynctask http://instructure.github.io/blog/2013/12/09/volley-vs-retrofit/ https://github.com/amitshekhariitbhu/Fast-Android-Networking https://stackoverflow.com/questions/25739620/why-should-i-use-okhttp-instead-of-android-httpclient-and-asynctask

Continue reading

Volley in Android

Volley is a networking library was introduced to make networking calls much easier, faster without writing tons of code. Volley is now officially supported by Google. By default all the volley network calls works asynchronously, so we don’t have to worry about using asyncTask anymore. Volley provides a lot of features few of them are:- […]

Continue reading

OkHTTP

Android initially provide two HTTP clients Apache HTTP Client and HttpURLConnection for receiving and sending data. DrawBack of Apache HTTP Client and HttpURLConnection Each of these clients required a lot of boilerplate code as it has to place inside the AsyncTask or Background Threads. It becomes very complicated for cancelling an HTTP request or connection […]

Continue reading

Architectural Design in android

Why Architectural Design like MVC/MVP ? MVC/MVP aims to decouple components as much as possible: As proper MVP and MVC implementations have the following characteristics: Readable and maintainable code Modular code which provides high degree of decoupling More testable code Code which is fun to work with   We various type of Variation in these  […]

Continue reading

Apache HttpClient

Apache HttpClient The Apache HttpClient library allows us to make HTTP requests. Add HttpClient Library to your project

For latest Version:-  https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient Creating HTTP Client and HTTP Post

Building Post Parameters:- The following code will create post parameters pair with key and value.

URL Encoding POST data:-Before making HTTP request you need […]

Continue reading

Common API in Android

Networking Libraries Retrofit by Square Volley by Google OkHTTP by Square HttpURLConnection HttpClient Comparison of Android networking libraries Image loading library Picasso Glide Picasso vs Glide   Push Notifications Firebase Google Cloud Messaging   Dependency Injection Butter Knife   JSON Reader Android provide inbuild JSON reader, but it is easier to use These Third part API. […]

Continue reading

Kotlin

Kotlin Kotlin is an open source, statically typed language based on Java Virtual Machine (JVM), with 100% interoperable with Java. Note:- You can also compile it to JavaScript or Native for building code that can run on iOS. Interoperable with Java, i.e. You can have Java and Kotlin code existing side by side in the […]

Continue reading

Android Sensor

The Android classifies sensors in three categories:- Motion Sensors:- These are used to measure acceleration forces and rotational forces along with three axes. Environmental sensors:– These are used to measure the environmental changes such as temperature, humidity etc. Position sensors:-These are used to measure the physical position of a device. Android Sensor API Some important […]

Continue reading

Android ProGuard

ProGuard is a free Java class file shrinker, optimizer, obfuscator, and preverifier. It detects and removes unused classes, fields, methods, and attributes. It optimizes bytecode and removes unused instructions. It renames the remaining classes, fields, and methods using short meaningless names. The resulting applications and libraries are smaller, faster, and a bit better hardened against […]

Continue reading

Android Lint

The Android lint tool is a static code analysis tool that checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization. Here are some examples of the types of errors that it looks for: Missing translations (and unused translations) Layout performance problems (all the issues […]

Continue reading