發表文章

目前顯示的是 6月, 2016的文章

Firebase setting in Google Mobile Ads SDK in AdMob - Android studio

Everyone have question when user to generate a ads in AdMob. Why AdMob give me : ads-unit-id: e.g. ca-app-pub-3940256099942544/6300978111 ( a test) application-unit-id: e.g. ca-app-pub-xxxxxxxxxxxxxx~xxxxxxxxxx Before user might not need to set application-unit-id in onCreate() in java code, but now if you want use Firebase, you should use and set in java. Google Teaching: https://firebase.google.com/docs/admob/android/quick-start#project-level_buildgradle_excerpt

How to set ToolBar and replace ActionBar - Android

圖片
1. Build a XML file, toolbar.xml, in layout folder in your Android project. 2. Toolbar.xml can be like this as below for a default style. <android.support.v7.widget.Toolbar     xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:local="http://schemas.android.com/apk/res-auto"     android:id="@+id/toolbar"     android:layout_width="match_parent"     android:layout_height="?attr/actionBarSize"     android:background="@color/holo_blue_dark"     local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"     local:popupTheme="@style/ThemeOverlay.AppCompat.Light" /> There are some important commands and do not miss them becuase they can affect the size, color,.... as you see the same with ActionBar. 3. Include toolbar.xml to the activity object you need to add the ToolBar <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     android