【问题标题】:How to remove special characters from csv file while importing into sqlite database in android如何在导入到android中的sqlite数据库时从csv文件中删除特殊字符
【发布时间】:2019-08-03 16:57:34
【问题描述】:
Since i cant ask new questions i'm editing my older questions, I have an csv file named barcode, i have successfully imported that into my sqlite db but the problem is while importing the values are inserted with special characters like what we have in csv file. 

我的条形码数据库:

EAN_CODE    ITEM
   8.90103E+12  100047253
   8.90103E+12  100047253
   8.90103E+12  100047253

我想删除我的 EAN_CODE 列中的特殊字符,我试过这个:

    String[] str = line.split(",");

                        arrayList_stock2.add(new 
    MasterDataModel2(str[0].replaceAll("\"", ""), 
    str[1].replaceAll("\"","")));

【问题讨论】:

  • 使用SMS Retriever API 否则在Play商店上传时会遇到问题
  • Google 已限制使用短信读取权限。您可以在此处找到更多详细信息:support.google.com/googleplay/android-developer/answer/9047303 您应该按照@ManoharReddy 的建议使用 SMS Retriever API
  • Goggle 在 Play 商店上传时限制了 SMS 和 PHONE 读取权限,您会收到错误消息。因此请使用 Manohar Reddy 建议的 SMS retriver api 或者如果您使用的是 Firebase Auth,则不需要 SMS Retriver .您可以为此学习教程。

标签: android sqlite csv import


【解决方案1】:

您正在尝试的方式需要短信许可,并且受到 google 的限制。 欲了解更多信息,请阅读this

相反,他们已经介绍了

Automatic SMS Verification with the SMS Retriever API

您可以在 Android 应用中进行基于短信的用户验证 自动,无需用户手动输入 验证码,无需任何额外的应用权限 使用 SMS Retriever API。

【讨论】:

  • 欢迎您,祝您好运。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-12-14
  • 2021-08-09
  • 2021-07-15
  • 1970-01-01
  • 1970-01-01
  • 2013-11-02
相关资源
最近更新 更多