Okhelp.cz

Recepty, články, nápady, programování. Dříve dum-zahrada, finance, internet a know-how.okhelp.cz Pro lepší výsledky hledání používejte i diakritiku.

configChanges value of the com.google.ads.AdActivity must include


AD MOB

Errors:
E/Ads(333): The android:configChanges value of the com.google.ads.AdActivity must include screenLayout.
E/Ads(333): The android:configChanges value of the com.google.ads.AdActivity must include uiMode.
E/Ads(333): The android:configChanges value of the com.google.ads.AdActivity must include screenSize.
E/Ads(333): The android:configChanges value of the com.google.ads.AdActivity must include smallestScreenSize.
E/Ads(333): You must have AdActivity declared in AndroidManifest.xml with configChanges.

Solution:
Try to using a lower version of the GoogleAdMobAdsSDK ADS SDK in project:
GoogleAdMobAdsSDK-4.0.4
How add SDK to project

Add activity to AndroidManifest.xml


// .............. blah
    <uses-sdk android:minSdkVersion="4"/>
   <uses-permission android:name="android.permission.INTERNET" />
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application android:icon="@drawable/dicts_ico" android:label="@string/app_name" 
    >
           <meta-data 
        android:value="a12345_your_number" 
        android:name="ADMOB_PUBLISHER_ID" />
        <activity android:name=".MainStartMenu"
                  android:label="@string/app_name"
                  android:configChanges="keyboardHidden|orientation"
                  >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>


  <!-- Google ads -->      
<activity android:name="com.google.ads.AdActivity"
              android:configChanges="keyboard|keyboardHidden|orientation"/>

// ......... blah 

397LW NO topic_id




AD

Další témata ....(Topics)


27

Get Context Java Android example | get-context-java-android-example


getContext() getApplicationContext() method Java Android example source






Context myContext_1 = ThisClassName.this; // to open a Dialog
Context myContext_2 = getContext();
Context myContext_3 = this.getContext();
Context myContext_4 = this;
Context myContext_5 = this.getApplicationContext ();


OnClickListener getImageBtnOnClick = new OnClickListener() {
public void onClick(View view) {
Context context = view.getContext();

}
};
// Toast
Toast.makeText(getApplicationContext(), "Context == getApplicationContext "
, Toast.LENGTH_SHORT).show();



// store Context in public class
public class MyActivity extends Activity {
public static Context myCnt = null;
...
protected void onCreate(Bundle icicle) {
...
myCnt = this;
MyStorage.setContext(myCnt);
// or
// MyStorage.setContext(this);

// cntxFromStorage == this
Context cntxFromStorage = MyStorage.getContext();
...
};
};

public class MyStorage
{
private static Context cntStorageContext = null;


public static Context getContext() {
return cntStorageContext;
}

public static void setContext(Context context) {
MyStorage.cntStorageContext = context;
}


};

class DataBaseHelper extends SQLiteOpenHelper {
// get MyActivity context
Context cnt = MyStorage.getContext();

}



128

How get Drawable Android example | how-get-drawable-android-example


InputStream, getResources(),openRawResource()

 java.io.InputStream is;
is = context.getResources().openRawResource(R.drawable.my_image);

Drawable mDrawable = context.getResources().getDrawable(R.drawable.button);
mDrawable.setBounds(150, 20, 300, 100);


Drawable[] mDrawables;
int[] resIDs = new int[] {
                R.drawable.btn_ok,
                R.drawable.btn_storno,
                R.drawable.btn_help
            };
            mDrawables = new Drawable[resIDs.length];
            Drawable prev = mDrawable;
            for (int i = 0; i < resIDs.length; i++) {
                mDrawables[i] = context.getResources().getDrawable(resIDs[i]);
                mDrawables[i].setDither(true);
                addToTheRight(mDrawables[i], prev);
                prev = mDrawables[i];
            }


103

Android RadioGroup alignment like TableLayout | android-radiogroup-alignment-like-tablelayout


xml example source code with image.


   <TableLayout android:layout_width="match_parent" android:id="@+id/idTableInRadioGroup" android:layout_height="wrap_content">
        <TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content" android:layout_height="wrap_content">


<RadioGroup android:id="@+id/idRadio_group_1_column"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:orientation="vertical">
 <RadioButton android:id="@+id/idRadio_1"
                android:text="@string/textLabel_1"/>
            <RadioButton android:id="@+id/idRadio_2"
                android:text="@string/textLabel_2"/>
            <RadioButton android:id="@+id/idRadio_3"
                android:text="@string/textLabel_3"/> 
 
        </RadioGroup>
<RadioGroup android:id="@+id/idRadio_group_2_column"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:orientation="vertical">
 
  <RadioButton android:id="@+id/idRadio_4"
                android:text="@string/textLabel_4"/>
            <RadioButton android:id="@+id/idRadio_5"
                android:text="@string/textLabel_5"/>
            <RadioButton android:id="@+id/idRadio_6"
                android:text="@string/textLabel_6"/>
        </RadioGroup>
</TableRow>        
    </TableLayout>



two-column-radiogroup-menu
153

Rotate Canvas with Bitmap Android example | rotate-canvas-with-bitmap-android-example


drawPath, canvas.rotate, lineTo basic Android example for your testing.





canvas-rotate-image-android-1


canvas-rotate-image-android




// //www.apache.org/licenses/LICENSE-2.0
// The Android Open Source Project
public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(new SampleView(this));
	}

	private static class SampleView extends View {
		private Paint mPaint = new Paint();
		private Path mPath = new Path();

		// CONSTRUCTOR
		public SampleView(Context context) {
			super(context);
			setFocusable(true);

			// Construct a wedge-shaped path
			mPath.moveTo(0, -60);
			mPath.lineTo(-20, 80);
			mPath.lineTo(0, 60);
			mPath.lineTo(20, 80);
			mPath.close();
		}

		@Override
		protected void onDraw(Canvas canvas) {
			Paint paint = mPaint;

			canvas.drawColor(Color.WHITE);

			paint.setAntiAlias(true);
			paint.setColor(Color.RED);
			paint.setStyle(Paint.Style.FILL);
			Bitmap bitmapOrg = BitmapFactory.decodeResource(getResources(),
					R.drawable.flower_blue);
			canvas.drawBitmap(bitmapOrg, 10, 10, paint);
			int w = canvas.getWidth();
			int h = canvas.getHeight();
			int cx = w / 2;
			int cy = h / 2;

			canvas.translate(cx, cy);
         // uncomment next line 
			//canvas.rotate(90.0f);
			canvas.drawPath(mPath, mPaint);
		}

	}
}
113

Problem in parsing the package Android 2.1 | problem-in-parsing-the-package-android-2-1


Eclipse.
If install on device signed with proguard *.apk package and try to reinstall it by only signed package get error in parsing the package.
Uninstall the first application with bigger size from device and try install signed package which has a smaller size. Delete from download list previous downloaded *.apk.
This problem occurs when that your downloaded apk file size is less than the
size of the original apk.


Editace: 2014-02-15 20:33:05
Počet článků v kategorii: 397
Url:configchanges-value-of-the-com-google-ads-adactivity-must-include

AD
11 Share
Share
Tweet