Author name: Laura Prata

Articles

Android Activity launchMode

In Android you can specify activity launchMode. You can do this either from AndroidManifest.xml file, either using intents with flags. Some of the flags produce the same effects like those from AndroidManifest.xml, but there are some flags that can be declared only with intents and also there are flags that can be declared only inside […]

, , , , , , ,
Tutorial

Android Add Game Leaderboard

In order to display leaderboards from your game you will have to set up your project and to be signed in. Below you will learn how to do this. Project Setup Download the Android samples from https://github.com/playgameservices/android-basic-samples Import BaseGameUtils into your project as module  Go to the directory where you downloaded android-basic-samples and select libraries -> BaseGameUtils If you get

, ,
Tutorial

Android ViewPager Tutorial

In Android, if you need to swipe from right to left or vice-versa in order to see different data, you can use a ViewPager. In order to use it, you have to implement a PagerAdapter which will generate the pages that the view shows. ViewPager’s adapters We can use one of the 3 adapters provided:

, , , , , , ,
Tutorial

Android ViewPager Cube Animation

After trying some libraries in order to make a cube animation for my viewPager, I realized that is pretty easy to do this. Android provides an interface called ViewPager.PageTransformer and you just have to implement its method transformPage(). Below is the code, step by step. activity_main.xml <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”match_parent” android:layout_height=”match_parent” tools:context=”ro.helpproject.funcode.help.MainActivity”>

, , , , ,
Articles, Solutions

Android – HTML in textView

Display HTML format First we will present below what are the supported tags for a textView and what are not supported. You can skip this section if you are already familiar with these or you want to jump directly into action :) Supported tags Unsupported tags <a href=”…”> <b> <big> <blockquote> <br> <cite> <del> <dfn>

, , , , , , , , , ,
Articles

Kotlin – How to pass a function as parameter

Recently, I’ve noticed that there are a few different ways to pass a function as parameter in Kotlin. In this post I will use 2 functions: sum and divide. We have to declare the sum function, in such way that it can receive the divide function as argument. The most common and often more convenient

, , , , , ,
Privacy Policy

Functions in Kotlin

In this post I will talk about 5 cool things that functions can do in Kotlin, better than methods in Java.   1. Forget about overloaded methods In Java, when you need the same method to have 1 parameter in one case and more parameters in another case, you would have to overload the method.

, , , , , ,
Privacy Policy

Anonymous Functions and Lambdas – Kotlin

Note! This is a post for beginners in Kotlin language. What are lambdas and anonymous functions? In order to define them let’s see what is a function literal. Function literal Function literal is a function that was not declared, but was passed as an expression. val sum = { a: Int, b: Int -> a + b

, ,
Privacy Policy

Kotlin – Hello world

Introduction What is Kotlin? It is a new programming language built by JetBrains, and as you may already know, Google announced at Google I/O 2017, that they will now officially support this language. It is inspired by existing languages such as Java, C#, JavaScript, Scala and Groovy. What are the advantages of using Kotlin? it’s

,
Tutorial

Android Navigation View With Tabs

In this tutorial we will create a simple app which has a NavigationView, a Toolbar with Tabs and a simple list of items, that are displayed for each selected tab. Tools used: Android Studio 2.2 Preview 4 Android Emulator 5x API 22 Project Create a new project by choosing the empty template and then click

, , , , , , ,
Solutions

Android: CoordinatorLayout RecyclerView First Item not visible

Problem I had to implement a Toolbar with tabs, together with CoordinatorLayout, and the content of each tab had to be a list of items, for which I used RecyclerView. But when I ran the app, the first item in the list was overlapped by the tabs, so it was not fully visible. This is how my xml

, , , , ,
Solutions

Android Studio can’t open Android Device Monitor

Problem Recently I had this issue: my Android Device Monitor didn’t open and and an error log file was generated every time I was tring to open it, under Android – sdk – tools – lib – monitor-x86_64 – configuration. Also, I have to mention that it happened on Windows. I googled it and found different answers but none

,
Tutorial

Android AdMob With Firebase

About Firebase First of all, you have to know that using AdMob with Firebase is optional, at least for now, and you can still integrate AdMob by importing compile ‘com.google.android.gms:play-services’ (like in this tutorial). But even if it is optional, it is recommended, as it brings all services like AdMob, Analytics, crash reporting and other services together in just

, , ,
Scroll to Top