sl4a icon indicating copy to clipboard operation
sl4a copied to clipboard

When scanning a barcode, SCAN_RESULT_BYTES is a strange format.

Open kuri65536 opened this issue 9 years ago • 0 comments

https://github.com/kuri65536/python-for-android/issues/63

SCAN_RESULT_BYTES is not bytes array in python.

  def _rpc(self, method, *args):                                                
    data = {'id': self.id,                                                      
            'method': method,                                                   
            'params': args}                                                     
    request = json.dumps(data)                                                  
    self.client.write(request+'\n')                                             
    self.client.flush()                                                         
    response = self.client.readline()                                           
    self.id += 1                                                                
    result = json.loads(response)                                               
    if result['error'] is not None:

In self.client.readline(), response is already contains the converted string 'SCAN_RESULT_BYTES'.

kuri65536 avatar Jun 20 '15 05:06 kuri65536