Tutorial by Examples

You can add a "Browse Our Other Apps" button in your app, listing all your(publisher) applications in the Google Play Store app. String urlApp = "market://search?q=pub:Google+Inc."; String urlWeb = "http://play.google.com/store/search?q=pub:Google+Inc."; try { I...
The internet is packed with tips for performance improvement of Java programs. Perhaps the number one tip is awareness. That means: Identify possible performance problems and bottlenecks. Use analyzing and testing tools. Know good practices and bad practices. The first point should be done d...
In Java, it's too "easy" to create many String instances which are not needed. That and other reasons might cause your program to have lots of Strings that the GC is busy cleaning up. Some ways you might be creating String instances: myString += "foo"; Or worse, in a loop or...
1. What is MVC? The Model View Controller (MVC) Pattern is a design pattern most commonly used for creating user interfaces. The major advantage of MVC is that it separates: the internal representation of the application state (the Model), how the information is presented to the user (the View...
Here's the utility class: public class SharedPreferencesCompat { public static void putStringSet(SharedPreferences.Editor editor, String key, Set<String> values) { if (Build.VERSION.SDK_INT >= 11) { while (true) { try { ...
put this code inside your ViewHolder note: In this code I am using btnExpand click-event, for whole recyclerview click event you can set listener to itemView object. public class MyViewHolder extends RecyclerView.ViewHolder{ CardView cv; TextView recordName, visibleFile, date, t...
If you just want to get data, but not modify anything, you can turn off change tracking and proxy creation. This will improve your performance and also prevent lazy loading. Bad Example: using(var context = new Context()) { return await context.Set<MyEntity>().ToListAsync().ConfigureAw...
The Preview pane displays default values for data binding expressions if provided. For example : android:layout_height="@{@dimen/main_layout_height, default=wrap_content}" It will take wrap_content while designing and will act as a wrap_content in preview pane. Another example i...
Key is a field in a table which uniquely identifies each row/record in a database table. Use this attribute to override the default Code-First convention. If applied to a property, it will be used as the primary key column for this class. using System.ComponentModel.DataAnnotations; public clas...
The alert method displays a visual alert box on screen. The alert method parameter is displayed to the user in plain text: window.alert(message); Because window is the global object, you can call also use the following shorthand: alert(message); So what does window.alert() do? Well, let's ta...
A component can be registered either globally or locally (bind to another specific component). var Child = Vue.extend({ // ... }) var Parent = Vue.extend({ template: '...', components: { 'my-component': Child } }) Thiw new component () will only be available in...
You can extend and register a component in one step: Vue.component('custom-component', { template: '<div>A custom component!</div>' }) Also when the component is registered locally: var Parent = Vue.extend({ components: { 'custom-component': { templa...
Passing an object to the data property when registering a component would cause all instances of the component to point to the same data. To solve this, we need to return data from a function. var CustomComponent = Vue.extend({ data: function () { return { a: 1 } } })
One of the ways components can communicate with its ancestors/descendants is via custom communication events. All Vue instances are also emitters and implement a custom event interface that facilitates communication within a component tree. We can use the following: $on: Listen to events emitted ...
public class VolleyErrorHelper { /** * Returns appropriate message which is to be displayed to the user * against the specified error object. * * @param error * @param context * @return */ public static String ...
Classes without dependencies can easily be created by dagger. public class Engine { @Inject // <-- Annotate your constructor. public Engine() { } } This class can be provided by any component. It has no dependencies itself and is not scoped. There is no further code necessar...
In order to obtain a Google Maps API key for your certificate, you must provide the API console with the SH1-fingerprint of your debug/release keystore. You can obtain the keystore by using the JDK's keytool program as described here in the docs. Another approach is to obtain the fingerprint progr...
The following abstract defines an EmailAddress type based on the String type which will use a regular expression to validate the passed argument as an e-mail address. If the address isn't valid, an exception will be thrown. abstract EmailAddress(String) { static var ereg = ~/^[\w-\.]{2,}@[\w-\.]...
Windows : for %f in (C:\your_app_path\*.apk) do adb install "%f" Linux : for f in *.apk ; do adb install "$f" ; done

Page 561 of 1336