Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8297745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:31:36+00:00 2026-06-08T15:31:36+00:00

Possible Duplicate: How can I get device ID for Admob My activity has a

  • 0

Possible Duplicate:
How can I get device ID for Admob

My activity has a ListView and I’ve put an ad at the bottom. When I run the app on the emulator, I see the test ad. When I run on my phone, I get an actual ad. I want to test on my phone and not get real ads.

I followed the instructions on the AdMob site about looking in logcat for a message stating how to manually add the device ID to the AdRequest. The problem is this message would never appear in logcat. This is a RAZR running 4.1. In an SO post, answered by Aracem, I read that the encoded string is available in the Developer Options preference panel, and I found it. When I read the guide for this command, the format of the device ID was alphanumeric (e.g. “E83D20734F72FB3108F104ABC0FFC738”), but the value in my phone contains letters, numbers, and dashes (e.g. “MQKF-RB61-BBKS-E”).

I’ve added the encoded device ID into the XML googleads:testDevices and I’ve also manually added an AdRequest into my onCreate and use addTestDevice with this string. Neither work.

One thing that I’ve noticed is the namespace that works is googleads, not ads as shown in the examples. When I use ads, I get prefix errors in the XML. I’m guessing with the switch from 4.x to 6.1, the namespace changed.

I can make this happen with the minimal project where onCreate does nothing more than call super and setContentView.

Layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mainLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ListView
    android:id="@+id/list"
    android:layout_above="@+id/adView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" />
<com.google.ads.AdView
    xmlns:googleads="http://schemas.android.com/apk/lib/com.google.ads"
    android:id="@id/adView"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    googleads:adSize="BANNER"
    googleads:adUnitId="@string/admob_id"
    googleads:loadAdOnCreate="true"
    googleads:testDevices="TEST_EMULATOR, MQKF-RB61-BBKS-E" />

Manifest

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="16" />
<application android:label="@string/app_name" >
    <activity
        android:name="mainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
</application>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T15:31:37+00:00Added an answer on June 8, 2026 at 3:31 pm

    In the Logcat, you will find the device ID. You will see something like

    To get test ads on this device, call adRequest.addTestDevice(“**”)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How can I get device ID for Admob I am testing adMob
Possible Duplicate: Android: How can I get the current foreground activity (from a service)?
Possible Duplicate: How can I get a reference to a node directly after it
Possible Duplicate: How can I get a list of all the defined variables in
Possible Duplicate: CSS - percentage height I can't get the middle div of 3
Possible Duplicate: Getting odd/even part of a sequence with LINQ How can I get
Possible Duplicate: get name of current PHP script in include file Can an included
Possible Duplicate: How to get all of the IDs with jQuery? How can i
Possible Duplicate: Can I run from command line program created by Eclipse? I am
Possible Duplicate: Can I get more than 1000 records from a DirectorySearcher in Asp.Net?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.