Filtering is really easy in Angular JS. In Angular JS we use the “filter” keyword to do the filtering. Example Copy and paste the above code in an html and run. You will see the result. Here we have a variable named “my_search” which is a textbox in HTML. so the filter value is taken… Read More »
Apart from other languages, when you write a class in Swift, It should have a initialiser. To solve this we have to write init() function in that particular class. Just like below. For example, look at the below class. Here we have 5 variables. The above error usually comes when you don’t initialize all variables… Read More »
You can use the ng-bind directive, which will bind the innerHTML of the element to the specified model property: Method 1 Method 2 Complete Example
With the ng-model directive you can bind the value of an input field to a variable created in AngularJS. Here we will have two input fields which will bind to two variables in Angular JS. Example Just copy paste the above code to your editor and save in html and see the result.
This example helps you to find the location in Android using the GPS. I have commented out some functionality in the code. You can uncomment it and extend it at your wish. At first we will create a utility class that will handle all GPS related Operations. GPS Utility Class This class has all utility… Read More »
Floating widgets float over the screen over any app that is currently running. Here we will make a floating action button that you can drag around the screen to position and do actions on it. Add Permission For drawing over the other apps, you need “android.permission.SYSTEM_ALERT_WINDOW” permission. So add this entry in your manifest. Our… Read More »
Angular JS modules means : An AngularJS module defines an application. The module is a container for the different parts of an application like controller, services, filters, directives etc. The module is a container for the application controllers. Controllers always belong to a module. Example Here we have a module named “MyApp” and controller for… Read More »
We often need to transfer images between activities. Well there are many methods to transfer images. You can make the image into a Base64 String and pass it as String argument extra in a bundle between activities You can save it to a disc and read it in the other activity. Well, these methods will… Read More »
Here is a comprehensive list of Angular JS Directives. Directive Description ng-app It defines the root element of an application. ng-bind It binds the content of an html element to application data. ng-bind-html Itbinds the innerhtml of an html element to application data, and also removes dangerous code from the html string. ng-bind-template It specifies… Read More »
We have to override the getBodyContentType() method in volley to enable “form-urlencoded parameters” in POST request using Volley. Here is how the code will look like. If you are not familiar with Volley, Checkout my post here on volley. It will give you a perfect picture on what Volley can do. Code – Method 1… Read More »
You may be knowing that RecyclerView is part of the material design, so it will have the built in animations when you add an element or remove and element. In today’s article, I will show you how to how to do this in a simple way. RecyclerView will perform a relevant animation if any of… Read More »
To get started with this, you need the latest version (version 25) of Android SDK & tools (including SDK tools, build-tools, platform-tools, support repository). Gradle Add the design support library First step is to add the design support library to your app-level build.gradle file. Example is as shown below: Layout Add the BottomNavigationView to your… Read More »
Hi all, You want to design your app with beautiful material design icons… here is the link… Go and use it and make your app beautiful.
Weak reference objects, which do not prevent their referents from being made finalizable, finalized, and then reclaimed. Weak references are most often used to implement canonicalizing mappings. Suppose that the garbage collector determines at a certain point in time that an object is weakly reachable. At that time it will atomically clear all weak references… Read More »
Android comes with a built in feature for Speech to Text. This is really helpful when you want to provide navigation in your app through voice commands. When you say something in the app, your voice will be streamed to the server and the server will convert it to text and send back. You can… Read More »
Android uses a centralized logging system. However you can write your own custom log statements. Log Statements To write log statements, you use use the android.util.Log class with the following methods: Log.v() Log.d() Log.i() Log.w() Log.e() Log.wtf() They are sorted by relevance with Log.i() being the least important one. The first parameter of these methods… Read More »
This is simple, just do like this. It would be better if you do this once in the Class that extends the Application Class.
This is a simple trick in Android Studio. First you have to write the skeleton of your function like this Now to generate the comments for this function just type “/**” on top of the function and hit “enter”. You will see the comments generated for you. Now your function will look like this Leave… Read More »
Read about this from my new programming website http://codespower.com/2017/05/25/difference-between-shared-and-portable-app-in-xamarin/
This article shows how you can do simple image scaling in Android. Here I have a simple class that Scales the image. The Utility class Layout The layout which shows the image for scaling. Set the above xml as layout for the Activity. Activity Please leave your comments at the end of the post.
The popup windows is a floating container that appears on top of the current activity. Layout for PopUp Below is the layout for the popup window. Layout for Activity Create another layout for the activity activity_main.xml Implementation The activity which implements the popup.
Hi all, Today I will show you how you can implement Client-Server architecture in an Android environment. What is a socket? An interface between application and network The application creates a socket The socket type dictates the style of communication reliable vs. best effort connection-oriented vs. connectionless Once configured the application can pass data to… Read More »
Using Shelvesets in TFS we can set aside pending changes in Visual Studio 2015. We can set aside a batch of pending changes from our current work space temporarily using the feature Shelvesets . We can later restore these changes into our work space or can into work space of another user. Read more from… Read More »