我正在创建一个社交媒体应用程序,用户可以在其中共享图像、视频、音频等。通过在清单文件中添加以下代码,我成功地接收了从第三方应用程序共享的媒体。
<activity
android:name=".activity.SendToActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
现在,当用户尝试从他们的图库(如 facebook)(设置为个人资料图片)共享图片以直接上传个人资料图片时,我想显示我的应用程序的多个图标。请看截图
当用户尝试从他们的图库中共享图像时,请有人帮助我显示我的应用程序的多个图标。
我正在创建一个具有内容安全性的应用程序,因为没有人可以复制内容和文件.我使用密码直接从URL加密图像,而不是下载到设备.请在下面找到我的代码.
URL url = new URL(images.getImageurl());
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setDoOutput(true);
File folder = new File(Environment.getExternalStorageDirectory(), "zerb");
boolean success = true;
if (!folder.exists()){
folder.mkdirs();
}
InputStream fis = connection.getInputStream();
String path = folder.getAbsolutePath() + "images.getImageName + ".jpg";
encryptfile(fis, path, AppConstants.password + images.getContentid() + images.getTopicid())
fis.close();
Run Code Online (Sandbox Code Playgroud)
密码加密方法代码是
private static boolean encryptfile(InputStream inputStream, String path, String password) throws IOException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException {
FileOutputStream fos = new FileOutputStream(path.concat(".crypt"));
byte[] key = (AppConstants.salt + password).getBytes("UTF-8");
MessageDigest sha = MessageDigest.getInstance("SHA-1");
key = …Run Code Online (Sandbox Code Playgroud)