Content Provider – Part 2 – create and query

Content Provider – Part 2 – create and query

You can read part 1 here. To create a Content Provider you need to: extend the ContentProvider class implement the lifecycle methods implement the data lookup methods implement the modification methods create a Content Provider identification specify Content Provider’s visibility to other apps Content Provider is responsible to connect to the database and perform all the database interactions. The methods are similar to the SQLite API. Add a Content Provider to your app Right-click the package name, then click New, Other and then Content Provider. You will see the following…

Content Provider – Part 2 – create and query Read More

Android – Create a DB contract class

Android – Create a DB contract class

A Database contract class is a class that holds information about the database, schema/structure. It also has constants that describes the database, tables, columns and table creation strings. One more thing to remember is that we do not need instantiate it, because it holds only information. Let’s start. Create a new Java class file. The class must be final. The constructor should be private and empty. Now create a public, static and final class for each table in the database that implements Basecolums if you want to use an ID…

Android – Create a DB contract class Read More

Android Studio – Create and run a Virtual Device

Android Studio – Create and run a Virtual Device

It is important to have a Virtual Device, maybe more than one. You can run your app without the need for a physical device and you can also test your app in different specifications (screen size/resolution, API etc) Click Tools and then AVD Manager. You will see the following windows: Click Create Virtual Device. Select the category, then a device definition. I chose Nexus 5x. Click Next Click Other Images and select or Download the system image for your device. It is better to choose an armeabi-v7a and with Google…

Android Studio – Create and run a Virtual Device Read More

Android Studio – Create a project, source code and resource files

Android Studio – Create a project, source code and resource files

Start Android Studio. You will see the following. Click Start a new Android Studio project Choose what kind of project will be, the target platform Now choose what kind of activity you want to create with the project. Click Next. Now specify the Name,package name, save location, language and Minimum API level. Click Finish. Create a source code file. Right-click the package, click New and then click Java Class Specify the name and any other fields you need. Click OK Create a resource file. Right-click res, click New and then…

Android Studio – Create a project, source code and resource files Read More

Windows 10 – Create shortcuts

Screenshot 20190130 225945

Shortcut is a link that points to a folder, document, website and control panel item. You can create a shortcut in any location on your system even in Desktop and Taskbar. If you want to create a shortcut for a file or folder, right-click it, select Send to and the Desktop (create shortcut) You can see the shortcut on the Desktop. If you gonna click it, it will open if it is a file, or it will open file explorer if it is a folder You can also right-click an item, click…

Windows 10 – Create shortcuts Read More