Javascript – Data types and numbers

Javascript – Data types and numbers

Javascript has primitive types and objects primitive types: number 1, 5, 66 string ‘Hello’ “World” boolean true false null undefined objects: anything else than primitive types Remember that Javascript is a weakly typed language and you cannot declare the type of the variable. You can use the typeof operator to the find the type of a variable. numbers The numbers can be: integer 10, 6, 536363 signed integer -22 decimal 2.3 , -300.12 scientific notation 1e1, 2e+3 octal 017 hexadecimal 0xF1 NaN not a number Number operators Javascript has binary…

Javascript – Data types and numbers Read More

Javascript – Introduction and variables

Javascript – Introduction and variables

Javascript born in 1995 and initially inspired from Java. Is the only language you can run in a web browser and gives interactivity to the HTML documents. Javascript can also run outside the web browser on a nodeJS interpreter for example. Javascript is an interpreted language and compiled just-in-time which means that the code is converted just before runtime. With Javascript, you can change the CSS and HTML code, use geolocation and even work with data using Ajax. You can put your Javascript code: inside the HTML in a local…

Javascript – Introduction and variables Read More

Android – Notifications

Android – Notifications

Because of the notifications vary by the Android version, it is recommended to use the Notification compatibility class. Use the Notification Builder, and set the notifications settings with the set methods. The build method will create the instance, but to display a notification you need the NotificationManager which is called with getSystemService method. Create a notification ChannelId is a string that is used the channel that the notification will be assigned. You choose the id. setDefault specifies the notification defaults (light, vibration etc). setSmallIcon specifies the small icon that will…

Android – Notifications Read More

Content Provider – Part 3 – insert, delete, update, getType

Content Provider – Part 3 – insert, delete, update, getType

Please read the Part 1 and Part 2 insert First, create the variables needed for an insert get the code from the Urimatcher and create a switch statement for every kind of URI. Then insert the new row Create the rowUri with the help of ContentUris class and its method withAppendId To execute it: delete The same as insert, but change the switch statement And you can execute it: update and execute it : getType It returns the mime type of the data in the Content Provider. And because maybe…

Content Provider – Part 3 – insert, delete, update, getType Read More

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