내 앱에 admob 광고를 추가했습니다. 그 후, 내 애플 리케이션의 크기가 증가하고있다. Settings-App-MyApp (캐시가 아닌 저장소 데이터)에서 확인했습니다. 전화가 사용 가능한 메모리가 없거나이 크기에는 한도 (얼마나 큰가)가 없을 때까지 걱정이됩니다.AdMob에서 예상치 못한 데이터 저장 용량이 발생했습니다.
편집 :
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.GridLayout;
import android.support.v4.app.Fragment;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.GridLayout.LayoutParams;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.os.Build;
public class Failed extends Activity {
LinearLayout myL;
Button mB;
int checker=0;
int modeChecker=0;
int level=0;
AdView adView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.failed);
myL = (LinearLayout) findViewById(R.id.layoutFail);
adView = (AdView) this.findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);
Display display = getWindowManager().getDefaultDisplay();
int screenheight = display.getHeight();
if(screenheight>400){
myL.setPadding(0, 50, 0, 0);
}
if(screenheight>800){
myL.setPadding(0, 100, 0, 0);
}
if(screenheight>1000){
myL.setPadding(0, 250, 0, 0);
}
checker = getIntent().getExtras().getInt("type");
modeChecker = getIntent().getExtras().getInt("modeCheck");
level = getIntent().getExtras().getInt("level");
}
@Override
public void onBackPressed() {
}
public void tryAgain(View v){
if(level==1){
Intent intent = new Intent(Failed.this,FruitTwoTwo.class);
intent.putExtra("check", checker);
intent.putExtra("modeCheck", modeChecker);
startActivity(intent);
}
if(level==2){
Intent intent = new Intent(Failed.this,MainActivity.class);
intent.putExtra("check", checker);
intent.putExtra("modeCheck", modeChecker);
startActivity(intent);
}
if(level==3){
Intent intent = new Intent(Failed.this,FourFour.class);
intent.putExtra("check", checker);
intent.putExtra("modeCheck", modeChecker);
startActivity(intent);
}
if(level==4){
Intent intent = new Intent(Failed.this,FourFive.class);
intent.putExtra("check", checker);
intent.putExtra("modeCheck", modeChecker);
startActivity(intent);
}
if(level==5){
Intent intent = new Intent(Failed.this,MainActivityPlus.class);
intent.putExtra("check", checker);
intent.putExtra("modeCheck", modeChecker);
startActivity(intent);
}
if(level==6){
Intent intent = new Intent(Failed.this,SixSix.class);
intent.putExtra("check", checker);
intent.putExtra("modeCheck", modeChecker);
startActivity(intent);
}
if(level==7){
Intent intent = new Intent(Failed.this,SevenSix.class);
intent.putExtra("check", checker);
intent.putExtra("modeCheck", modeChecker);
startActivity(intent);
}
if(level==8){
Intent intent = new Intent(Failed.this,SevenE.class);
intent.putExtra("check", checker);
intent.putExtra("modeCheck", modeChecker);
startActivity(intent);
}
if(level==9){
Intent intent = new Intent(Failed.this,EightE.class);
intent.putExtra("check", checker);
intent.putExtra("modeCheck", modeChecker);
startActivity(intent);
}
finish();
adView.destroy();
}
public void goBack(View v){
Intent intent = new Intent(Failed.this,MenuActivity.class);
intent.putExtra("type", checker);
startActivity(intent);
adView.destroy();
finish();
}
@Override
public void onResume() {
super.onResume();
if (adView != null) {
adView.resume();
}
}
@Override
public void onPause() {
if (adView != null) {
adView.pause();
}
super.onPause();
}
/** Called before the activity is destroyed. */
@Override
public void onDestroy() {
// Destroy the AdView.
if (adView != null) {
adView.destroy();
}
super.onDestroy();
}
}
및 XML 파일 :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.testlogo.MyDialog"
android:background="@drawable/greenbackt"
android:orientation="vertical"
android:id="@+id/layoutFail"
>
<ImageView
android:id="@+id/failLogo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/failed"
android:layout_gravity="center"
android:paddingTop="20dp" />
<Button
android:id="@+id/fail"
android:layout_width="fill_parent"
android:layout_height="55dp"
android:layout_marginTop="27dp"
android:onClick="tryAgain"
android:layout_gravity="center"
android:text="@string/tryagain"
android:background="@drawable/button" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/line" />
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="55dp"
android:text="@string/back"
android:onClick="goBack"
android:background="@drawable/button" />
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="here is my adUnitId"
ads:adSize="BANNER"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" />
</LinearLayout>
데이터 저장이 증가하고, 그것은 어떤 활동에 무엇에 따라 달라집니다 없습니다. 활동에 AdMob 광고가 있고 인터넷 연결이 켜져 있으면 데이터 저장 용량이 증가합니다. AdMob 광고가없는 독창적 인 활동은 그렇지 않습니다. PS. Nexus 7을 사용 중입니다.
감사합니다. – mzfx
지금 테스트 중이며 데이터 저장 용량이 1,46 mb로 증가했습니다. \ 계속 올라가십시오. – mzfx
Admob에서 사용하는 저장 용량이 맞지 않습니다. 앱에 저장하거나 캐싱하는 다른 데이터는 무엇입니까? 앱의 다른 곳에서 WebViews를 사용하고 있습니까? – William