小编Dix*_*ine的帖子

使用Zxing(在Android手机上)解码存储在手机上的图像的qr码

我有一个从服务器接收qr代码的应用程序.我想解码它(不是意图和相机)并在我的应用程序中显示它包含的文本.我已经在Java SE中使用此代码使用来自zxing的jar来完成此操作:

 private class QRCodeDecoder {
         public String decode(File imageFile) {
         BufferedImage image;
         try {
         image = ImageIO.read(imageFile);
         } catch (IOException e1) {
         return "io outch";
         }

         // creating luminance source
         LuminanceSource lumSource = new BufferedImageLuminanceSource(image);
         BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(lumSource));

         // barcode decoding
         QRCodeReader reader = new QRCodeReader();

         Result result = null;
         try {
         result = reader.decode(bitmap);
         } catch (ReaderException e) {
         return "reader error";
         }

         return result.getText();

         }
        }
Run Code Online (Sandbox Code Playgroud)

但在Android上,找不到BufferedImage.有没有人从手机上存储的图像解码android上的qr代码?TNX.

java android decode qr-code

6
推荐指数
2
解决办法
1万
查看次数

如何使用2个不同颜色的标签制作UITableViewCell?

我想要像这样的UITableViewCell:

在此输入图像描述

"Tel:"的文本颜色必须与数字的文本颜色不同.现在我像往常一样将文本设置为单元格:

cell.textLabel.text=@"Something";
Run Code Online (Sandbox Code Playgroud)

是否有可能有1个标签并改变其某些部分的颜色?

如何在我的照片上制作表格?

谢谢.

iphone objective-c uitableview uilabel

6
推荐指数
2
解决办法
1万
查看次数

如何在nsstring中获取长度为2位数的nsstring长度?

我正在使用nsstring的长度并将其转换为nsstring.我需要这个最后长度为2位的字符串,所以例如单词"hello"在字符串中的长度为"05"而不是"5".

我的代码到目前为止:

NSString *sth=@"hello";
NSMutableString *result=[NSString stringWithFormat:@"%d", sth.length]; //string is "5" and not "05" that i need
Run Code Online (Sandbox Code Playgroud)

objective-c nsstring

6
推荐指数
2
解决办法
4万
查看次数

尽管init成功,但iOS的Firebase崩溃报告不会发送崩溃

我在我的iOS项目中添加了firebase崩溃报告(添加了pod,添加了构建阶段脚本,将json添加到项目中,......).当我运行我的应用程序时,我在我的控制台中看到:

Firebase Crash Reporting: Successfully enabled
Run Code Online (Sandbox Code Playgroud)

为了测试,我在我的FIRApp.configure()代码之后在我的代码中插入fatalError()(如下所示:https://firebase.google.com/docs/crash/ios#create_your_first_error ).

我的下一个应用程序启动时不会发送崩溃报告(不会崩溃).我在xcode控制台中看不到任何内容,在我的Web控制台中什么都没看到

ios firebase swift firebase-crash-reporting

6
推荐指数
1
解决办法
3675
查看次数

在相对布局中将textView定位在另一个textView下的问题

我想在textview中使用包含文本的textview来定位我的textview.我使用此布局并且文本视图重叠:

<?xml version="1.0" encoding="utf-8"?>

  <LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@drawable/back"
xmlns:android="http://schemas.android.com/apk/res/android">

<!--  we include header  -->
<include
    layout="@layout/header"/>

<Spinner
    android:id="@+id/spinner"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center_horizontal"
    android:layout_marginTop="15dip"
    android:layout_marginLeft="5dip"
    android:layout_marginRight="5dip"
    android:textColor="#ffffff"
    android:background="@drawable/spin" />

    <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content" 
android:background="#000000">

<TextView
    android:id="@+id/tv1"
    android:text="Some text to display:"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:layout_marginTop="10dip"
    android:textColor="#ffffff" />

    <TextView
    android:id="@+id/number"
    android:text="123 456 789"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:textSize="30dip"
    android:layout_marginTop="10dip"
    android:textColor="#ffffcc"/>   

    </RelativeLayout>

   </LinearLayout>
Run Code Online (Sandbox Code Playgroud)

我得到的是:

在此输入图像描述

layout android

5
推荐指数
2
解决办法
2万
查看次数

如何在浏览器或应用程序中显示格式化的大型JSON文件?

到目前为止,我使用Jsonview chrome扩展来查看格式化的json.现在我必须使用大型JSON文件(3MB)并且它会崩溃chrome.

什么应用程序或浏览器扩展,插件..你建议查看大型json文件?

plugins json

5
推荐指数
2
解决办法
9686
查看次数

是否可以在iPhone项目中使用一些C源代码?

我发现了一个支持多种语言的语音合成器(http://espeak.sourceforge.net/index.html).但是可用的源代码是用C语言编写的.

我该怎么做才能让它在iPhone上运行?

c iphone speech-synthesis

5
推荐指数
1
解决办法
167
查看次数

检查网络位置提供程序是否已启用的任何其他方法?

当我检查

boolean networkReady=manager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
Run Code Online (Sandbox Code Playgroud)

虽然在设置中不允许使用无线位置,但我会在某些三星手机上使用.

有没有其他方法可以检查此设置并在所有手机上获得正确的值?

java android location

5
推荐指数
1
解决办法
1236
查看次数

手动安装的apk(不是来自Play商店)会在更新可用时收到通知吗?

我想在平板电脑上预安装apk(知道该怎么做).

我的平板电脑是否会收到来自Play商店的通知,该更新已在Play商店准备就绪,我应该安装它吗?

android apk

5
推荐指数
2
解决办法
1万
查看次数

iOS Campaign Tracking URL Builder网站上的"设备ID宏"字段是什么?

我在此处使用广告系列跟踪网址构建器:https://developers.google.com/analytics/devguides/collection/ios/v3/campaigns#url-builder

我为"广告网络"字段选择"自定义".所需的一个参数是"设备ID宏",但我无法在文档中的任何位置找到它.

我在哪里可以找到"设备ID宏"参数?

google-analytics ios

5
推荐指数
1
解决办法
2121
查看次数