Posts

Build Gradle Component Definitions

Image
Common Gradle Command Prompt Command Description ./gradlew build build project, runs both the assemble and check task ./gradlew clean build build project complete from scratch ./gradlew clean build build project complete from scratch ./gradlew test

Increase Performance Android Studio

Image
Solver 1 You can speed up your Eclipse or Android Studio work, you just follow these: Open your single project clean your project after running your app in emulator every time use mobile/external device instead of emulator don't close emulator after using once, use same emulator for running app each time Disable VCS by using File->Settings->Plugins and disable the following things : CVS Integration Git Integration (Git & Github) Google Cloud Tools for Android Studio Subversion Integration Firebase (Optional) I am also using Android Studio with 4-GB installed main memory but following these statements really boost my Android Studio performance. Solver 2 Android Studio (up to 1.5GB) The IDE's JVM is configured to have a max heap size. You can see this in the lower-right corner of the main interface:

Dynamic load admob ads

<LinearLayout android:id="@+id/main_adTopBanner" android:orientation="vertical" android:layout_height="50dp" android:layout_width="match_parent"> </LinearLayout> @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); LoadAds(); } private AdView AD_TOP_BANNER = null; public void LoadAds() { // Create the adView. this.AD_TOP_BANNER = new AdView(this); this.AD_TOP_BANNER.setAdUnitId("MY_SPECIAL AND_UNIQUE_AD_ID"); // this.AD_TOP_BANNER.setAdSize(AdSize.BANNER); this.AD_TOP_BANNER.setAdSize(AdSize.SMART_BANNER); // Lookup your LinearLayout assuming it's been given LinearLayout layout = (LinearLayout) findViewById(R.id.main_adTopBanner); // Add the adView to it. layout.addView(this.AD_TOP_BANNER); // Initiate a generic request. AdRequest adRequest = null; adRequest = new AdRequest.Builder().buil