Tutorial by Examples: design

One (or two) of the coolest new features in recent Xcode releases are the IBInspectable properties and IBDesignable UIViews. These have nothing to do with the functionality of your application but instead impact the developer experience in Xcode. The goal is to be able to visually inspect custom v...
The AppCompat Support Library defines several useful styles for Buttons, each of which extend a base Widget.AppCompat.Button style that is applied to all buttons by default if you are using an AppCompat theme. This style helps ensure that all buttons look the same by default following the Material D...
A true relational database must go beyond throwing data into a few tables and writing some SQL statements to pull that data out. At best a badly designed table structure will slow the execution of queries and could make it impossible for the database to function as intended. A database table shoul...
There are several additional attributes that the Volley NetworkImageView adds to the standard ImageView. However, these attributes can only be set in code. The following is an example of how to make an extension class that will pick up the attributes from your XML layout file and apply them to the N...
Remember, all the best practices of typical web architecture still apply. For an excellent overview on the subject, please refer to Michael Nygard's excellent book Release It! Design and Deploy Production-Ready Software. Writing your app in Meteor doesn't absolve you of auditing third party librarie...
If you are just starting a new project, it's important to think about how you want to handle code signing. If you are new to code signing, check out the WWDC session that describes the fundamentals of code signing in Xcode. To properly code-sign your app, you have to have the following resources o...
AlertDialog is a subclass of Dialog that can display one, two or three buttons. If you only want to display a String in this dialog box, use the setMessage() method. The AlertDialog from android.app package displays differently on different Android OS Versions. The Android V7 Appcompat library pro...
This example shows the process from designing the shape you want to drawing it on a view. A specific shap is used but the concepts you learn can be applied to any shape. How to draw a Bézier path in a custom view These are the main steps: Design the outline of the shape you want. Divide the ou...
Using some setters, without setting all needed properties in the constructor(s) public final class Person { // example of a bad immutability private final String name; private final String surname; public Person(String name) { this.name = name; } public String ge...
Chaining and Chainable is a design methodology used to design object behaviors so that calls to object functions return references to self, or another object, providing access to additional function calls allowing the calling statement to chain together many calls without the need to reference the v...
Bottom sheets slide up from the bottom of the screen to reveal more content. They were added to the Android Support Library in v25.1.0 version and supports above all the versions. Make sure the following dependency is added to your app's build.gradle file under dependencies: compile 'com.android...
The term responsive web design was first coined by Ethan Marcotte in his famous article Responsive Web Design, published in 2010 in A List Apart. This Smashing Magazine article by Kayla Knight describes it as follows: Responsive Web design is the approach that suggests that design and developme...
C99 C99 introduced the concept of designated initializers. These allow you to specify which elements of an array, structure or union are to be initialized by the values following. Designated initializers for array elements For a simple type like plain int: int array[] = { [4] = 29, [5] = 31, [1...
These attributes are used when the layout is rendered in Android Studio, but have no impact on the runtime. In general you can use any Android framework attribute, just using the tools: namespace rather than the android: namespace for layout preview. You can add both the android: namespace attribu...
This example is directly derived from John Cooley’s design contest at SNUG’95 (Synopsys Users Group meeting). The contest was intended to oppose VHDL and Verilog designers on the same design problem. What John had in mind was probably to determine what language was the most efficient. The result...
When signing personal scripts or when testing code signing it can be useful to create a self-signed code signing certificate. 5.0 Beginning with PowerShell 5.0 you can generate a self-signed code signing certificate by using the New-SelfSignedCertificate-cmdlet: New-SelfSignedCertificate -Friendl...
This example assumes that you have already set up a Firebase Realtime Database. If you are a starter, then please inform yourself here on how to add Firebase to your Android project. First, add the dependency of the Firebase Database to the app level build.gradle file: compile 'com.google.firebase...
Note: The singleton is a design pattern. But it also considered an anti-pattern. The use of a singleton should be considered carefully before use. There are usually better alternatives. The main problem with a singleton is the same as the problem with global variables. They introduce external glo...
Data Access Object(DAO) design pattern is a standard J2EE design pattern. In this design pattern data is accessed through classes containing methods to access data from databases or other sources, which are called data access objects. Standard practice assumes that there are POJO classes. DAO can b...
For the layout above your customrow.axml file is as shown below <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_heigh...

Page 1 of 2