大家好今天我忙于相机操作只是在我的应用程序上应用了rutin相机动作并且apploving sdk键错误实际应用程序正常工作但我需要知道为什么我这个在我的安卓监视器上这个变暖
1。这是我的课程,我开始动作并将putExtra放入打算
public class CameraActionFragment extends Fragment
{
private static final int REQUEST_CODE_IMG = 2;// for image
private static final int REQUEST_CODE_VIDEO = 1;// for video
public static final int RESULT_OK = -1;
Button btn_frag_camera_image;
Button btn_frag_camera;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View view = inflater.inflate(R.layout.fragment_camera_action_3, container, false);
//return inflater.inflate(R.layout.fragment_camera_action_3, container, false);
btn_frag_camera_image = (Button) view.findViewById(R.id.btn_frag_camera_image);
btn_frag_camera = (Button) view.findViewById(R.id.btn_frag_camera);
// Image Action
btn_frag_camera_image.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getActivity(), "Hello From Image", Toast.LENGTH_SHORT).show();
Intent intenImatToSec = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intenImatToSec, REQUEST_CODE_IMG);
}
});
// Camera Action
btn_frag_camera.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intenImatToSec = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
startActivityForResult(intenImatToSec, REQUEST_CODE_VIDEO);
//intenImatToSec.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
//intenImatToSec.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 10);
//Toast.makeText(getActivity(), "Hello From Camera", Toast.LENGTH_SHORT).show();
}
});
return view;
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
if (requestCode == REQUEST_CODE_IMG) {
Bundle bundle = data.getExtras();
Bitmap bitmap = (Bitmap) bundle.get("data");
Intent intentBitMap = new Intent(getActivity(), DisplayImage.class);
// aldıgımız imagi burda yonlendirdiğimiz sınıfa iletiyoruz
ByteArrayOutputStream _bs = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 50, _bs);
intentBitMap.putExtra("byteArray", _bs.toByteArray());
startActivity(intentBitMap);
} else if (requestCode == REQUEST_CODE_VIDEO) {
Uri videoUrl = data.getData();
Intent intenToDisplayVideo = new Intent(getActivity(), DisplayVideo.class);
intenToDisplayVideo.putExtra("videoUri", videoUrl.toString());
startActivity(intenToDisplayVideo);
}
}
} }
1。我在这里播放我的视频
public class DisplayVideo extends Activity
{
private static final int REQUEST_CODE_VIDEO = 100;
VideoView videoView;
Button btn_cancel;
Button btn_send_cahallenge;
Button btn_image_play;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.display_video_activity);
videoView = (VideoView) findViewById(R.id.videoview_display_video_actvity);
btn_cancel = (Button) findViewById(R.id.btn_display_image_cancel);
btn_send_cahallenge = (Button) findViewById(R.id.btn_display_image_send_cahallenge);
btn_image_play = (Button) findViewById(R.id.btn_display_image_play);
// CameraActionFragmentten gelen uri
Bundle extras = getIntent().getExtras();
Uri myUri = Uri.parse(extras.getString("videoUri"));
videoView.setVideoURI(myUri);
btn_image_play.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
videoView.start();
}
});
btn_cancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences shp = getSharedPreferences("pref", MODE_PRIVATE);
SharedPreferences.Editor editor = shp.edit();
editor.putInt("frag_no", 2);
editor.commit();
startActivity(new Intent(getApplicationContext(), HomeActivity.class));
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_CODE_VIDEO && resultCode == RESULT_OK) {
Uri videoUrl = data.getData();
videoView.setVideoURI(videoUrl);
//videoView.setMediaController(new MediaController(getApplicationContext()));
//videoView.requestFocus();
}
}
}
第3。无法找到有关AppLovin SDK密钥的有用指南。我最近 定义了facebook sdk键,一切都很好,并在相机后 行动ı有这个问题
错误
E/AppLovinSdk: Unable to find AppLovin SDK key. Please add meta-data android:name="applovin.sdk.key" android:value="YOUR_SDK_KEY_HERE" into AndroidManifest.xml.
07-29 16:24:26.390 12911-12911/? E/AppLovinSdk: Called with an invalid SDK key from: java.lang.Throwable:
at com.applovin.impl.sdk.AppLovinSdkImpl.a(Unknown Source)
at com.applovin.sdk.AppLovinSdk.b(Unknown Source)
at com.applovin.sdk.AppLovinSdk.c(Unknown Source)
at com.applovin.sdk.AppLovinSdk.b(Unknown Source)
at com.qihoo.security.SecurityApplication.onCreate(360Security:263)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1014)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4806)
at android.app.ActivityThread.access$1600(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1452)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:234)
at android.app.ActivityThread.main(ActivityThread.java:5526)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
答案 0 :(得分:2)
您有正确设置AppLovin所需的无效SDK密钥
请尝试添加:
<meta-data android:name="applovin.sdk.key"
android:value="YOUR_SDK_KEY_HERE"/>
到AndroidManifest
标记内的application
文件。
答案 1 :(得分:0)
请检查下面的链接以找到AppLovin SDK密钥
Click Here打开AppLovin的密钥窗口