Tag: android

如何在android中的图像上放置引脚标记图像?

我是Android新手。 我正在开发一个项目,我将获得无线电信号值(我可以从API获取值)。 我有一个平面图。 平面图有厨房,大厅,卧室部分..如果我点击厨房部分,我需要在该部分放置一个带有无线电信号值的Pin图像。 单击“保存”后,我需要锁定该特定部分中的图像(带有值)。 同样,我可以根据要求放置许多Pin图像。 请给我一些相关的链接或示例代码来开发它。 我附上了图片供您参考。 任何帮助将非常感激。

获取ImageView的图像并将其发送到使用Intent的活动

我的应用程序中有许多产品网格。 当用户选择网格中的一个项目时,我将开始一个新的活动作为DIALOG框并显示项目的名称,数量和图像。 但是我无法动态发送图像源。 这是我的代码 gridView.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView parent, View v,int position, long id) { //Toast.makeText(getApplicationContext(),((TextView) v.findViewById(R.id.grid_item_label)).getText(), Toast.LENGTH_SHORT).show(); Intent item_intent = new Intent(MainActivity.this, Item.class); item_intent.putExtra(“name”,((TextView) v.findViewById(R.id.grid_item_label)).getText()); item_intent.putExtra(“quantity”,((TextView) v.findViewById(R.id.grid_item_quantity)).getText()); //my problem is here*************************************************** ImageView my_image = findViewById(R.id.grid_item_image).getDrawable(); item_intent.putExtra(“image”,my_image.getXXXXX()); //********************************************************************* MainActivity.this.startActivity(item_intent); } }); 我应该使用什么来从ImageView获取图像源?

如何在android中将位图转换为PDF格式

**我在“thepic”变量中有位图类型的位图。 imageUri = (Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM); String realpath=getRealPathFromURI(imageUri); thepic = BitmapFactory.decodeFile(realpath);**

谷歌界面X509TrustManager的不安全实现

我在谷歌播放中使用了一个应用程序,我收到了谷歌的一封邮件说: 您在此电子邮件末尾列出的应用使用了界面X509TrustManager的不安全实现。 具体而言,在与远程主机建立HTTPS连接时,该实现会忽略所有SSL证书validation错误,从而使您的应用容易受到中间人攻击。 要正确处理SSL证书validation,请在自定义X509TrustManager接口的checkServerTrusted方法中更改代码,以便在服务器提供的证书不符合您的期望时引发CertificateException或IllegalArgumentException。 我的应用使用“https”,我的checkServerTrusted()如下: TrustManager tm = new X509TrustManager() { public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { } public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { } public X509Certificate[] getAcceptedIssuers() { return null; } }; 然后我修改这个function: TrustManager tm = new X509TrustManager() { public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { […]

如何使用openCV或OCR tesseract从图像中提取文本?

可能重复: android OCR? 我目前正在基于Android手机中的图像捕捉进行文本识别项目。 我想问一下如何从图像中提取文本? 是否有任何openCV或OCR tesseract教程用于提取?

读取并显示传入的消息文本android

我是android开发的新手。我正在开发小型android应用程序。 在我的应用程序中,我想要检索新发送的短信并将此消息显示给用户。 我的代码看起来像 // HellowordActivity.java package com.example.helloword; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.app.Activity; import android.os.Bundle; import android.telephony.SmsMessage; import android.util.Log; import android.widget.Toast; public class HellowordActivity extends BroadcastReceiver { public void onReceive(Context context, Intent intent) { Bundle myBundle = intent.getExtras(); SmsMessage [] messages = null; String strMessage = “”; if (myBundle != null) { Object […]

做推片段动画

如何通过下一个片段进行推送当前片段的动画 这是我想要的动画: 我当前的动画代码只是将第一个片段与第二个片段重叠,它没有像图片中那样推动它 这是代码: result_list.setOnItemClickListener(new OnItemClickListener(){ @Override public void onItemClick(AdapterView av, final View view, final int i, long i2) { result_list.setEnabled(false); view.animate().setDuration(300).translationX(widthListView).alpha(0). withEndAction(new Runnable() { @Override public void run() { //setResult(Activity.RESULT_OK,new Intent().putExtra(“bussStopCode”, data.get(i).getStopCode()).putExtra(“bussStopName”, data.get(i).getStopName())); ////int get 1 //data.remove(i); int temporaryInteger = i; listLastPostion = temporaryInteger; //customAdapter.notifyDataSetChanged(); //view.setTranslationX(0); Log.d(“data”,conreq.getCollectedData().getBusRouteSetData().get(temporaryInteger – 1).getRouteHeading()); Bundle bundle = new Bundle(); […]

使用带有accountmanager令牌的imap访问gmail

我正在尝试使用从Android的AccountManager收到的令牌而不是使用用户名和密码来实现IMAP gmail客户端。 Google通过oauth2提供了此IMAP示例http://code.google.com/p/google-mail-oauth2-tools/source/browse/#svn%2Ftrunk%2Fjava%2Fcom%2Fgoogle%2Fcode%2Fsamples%2Foauth2 http: //code.google.com/p/google-mail-oauth2-tools/wiki/JavaSampleCode public static IMAPStore connectToImap(String host, int port, String userEmail, String oauthToken, boolean debug) throws Exception { Properties props = new Properties(); props.put(“mail.imaps.sasl.enable”, “true”); props.put(“mail.imaps.sasl.mechanisms”, “XOAUTH2”); props.put(OAuth2SaslClientFactory.OAUTH_TOKEN_PROP, oauthToken); Session session = Session.getInstance(props); session.setDebug(debug); final URLName unusedUrlName = null; IMAPSSLStore store = new IMAPSSLStore(session, unusedUrlName); final String emptyPassword = “”; store.connect(host, port, […]

Android开发将XML按钮链接到Java

我是Android开发的新手,我基本上试图创建一个非常基本的应用程序,它将使用户能够打开他们的wifi。 我的XML文件: ` 我的Java文件: package com.example.dosomething; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; public class MainActivity extends Activity implements OnClickListener { protected Button wifi_on; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar […]

如何创建videourl表单服务器的缩略图

如何创建urlvideo表单服务器的图像/缩略图 我尝试不工作(不显示缩略图) String String url = “http://clips.vorwaerts-gmbh.de/VfE_html5.mp4”; Bitmap thumb = ThumbnailUtils.createVideoThumbnail(url,MediaStore.Images.Thumbnails.MINI_KIND); Glide.with(context).load(thumb).asBitmap() /*.override(convertDpToPx(100), convertDpToPx(100))*/ .placeholder(R.drawable.camera) .override(200, 200) .diskCacheStrategy(DiskCacheStrategy.ALL) .into(new BitmapImageViewTarget(img_view) { protected void setResource(Bitmap resource) { RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(context.getResources(), resource); //circularBitmapDrawable.setCircular(true); img_view.setImageDrawable(circularBitmapDrawable); } }); 我通过回答1来解决它! 但是它在缩略图方面遇到了一些问题,它的变化颜色就是标准。 例