Skip to main content

Posts

Showing posts from April 25, 2016

Android RecyclerView and StaggeredGridLayoutManager with Picasso/Glide

This project is there in GitHub https://github.com/yuvaraj119/Picasso-RecyclerView-StaggeredGridLayoutManager You can download and start customizing it for your project also. How to use with Picasso Picasso + RecyclerView + StaggeredGridLayoutManager Its the enhanced version of this project https://github.com/pohh/slotmachinepicasso were there was a problem with Picasso + RecyclerView + StaggeredGridLayoutManager shuffles resizable recycler views infinitely issue posted on github https://github.com/square/picasso/issues/918 I have made some changes now it works with Picasso and Glide without any shuffles and position change Currently this project is done with Picasso If you want to use it with Glide How to use with Glide Glide + RecyclerView + StaggeredGridLayoutManager Add dependencies for Glide https://github.com/bumptech/glide Remove Picasso library from dependency and remove all the codes of Picasso from MyGridAdapter.java and also from other p

Android SMS/MMS in background using AsyncTask

Currently in android  from KITKAT sending SMS/MMS can be sent only by default SMS app. You have to make your app as default SMS app before sending sms/mms from your app (later we will discuss about this). Newly from 5.x android has removed “Enable/Disable” of mobile data programmatically, so in this case you have to manually enable your mobile data from settings. Here i am gonna use a library called “Android SMS/MMS/Google Voice Sending Library” which is created by Jacob Klinker. GitHub link:  Android SMS/MMS/Google Voice Sending Library To check whether app is default sms app or not add this in: AndroidManifest.xml . <!-- Activity that allows the user to send new SMS/MMS messages -->         <activity android:name = ".ComposeSmsActivity" >             <intent-filter>                 <action android:name = " android.intent.action.SEND " />                                 <action android:name = "a

Android Audio Recording in Background with Service

  In android audio recording is simple task but when it comes to record in background it becomes little bit difficult so here we are gonna explore audio recording with service. How to record a audio when the app is running in background ? In Android any task which has to be done in background we have to use extend Service Class. How does this Service Class works? A Service is an application component that can perform long-running operations in the background and does not provide a user interface. Another application component can start a service and it will continue to run in the background even if the user switches to another application. Additionally, a component can bind to a service to interact with it and even perform interprocess communication (IPC). For example, a service might handle network transactions, play music, perform file I/O, or interact with a content provider, all from the background. AudioService.class public class AudioService extends Serv

Android Debugging in Android Studio

Investigating Your RAM Usage Because Android is designed for mobile devices, you should always be careful about how much random-access memory (RAM) your app uses. Although Dalvik and ART perform routine garbage collection (GC), this doesn’t mean you can ignore when and where your app allocates and releases memory. In order to provide a stable user experience that allows the system to quickly switch between apps, it is important that your app does not needlessly consume memory when the user is not interacting with it. Even if you follow all the best practices for Managing Your App Memory during development (which you should), you still might leak objects or introduce other memory bugs. The only way to be certain your app is using as little memory as possible is to analyze your app’s memory usage with tools. This guide shows you how to do that. Interpreting Log Messages The simplest place to begin investigating your app’s memory usage is the runtime log messages. Some

HTML5

Structure Even well-formed HTML pages are harder to process than they should be because of the lack of structure. You have to figure out where the section breaks go by analyzing header levels. Sidebars, footers, headers, navigation menus, main content sections, and individual stories are marked up by the catch-all div element. HTML 5 adds new elements to specifically identify each of these common constructs: section : A part or chapter in a book, a section in a chapter, or essentially anything that has its own heading in HTML 4 header : The page header shown on the page; not the same as the head element footer : The page footer where the fine print goes; the signature in an e-mail message nav : A collection of links to other pages article : An independent entry in a blog, magazine, compendium, and so forth New Elements in HTML5 The following elements have been introduced for better structure: section represents a generic document or application section. It can be