#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2011
    Posts
    5
    Rep Power
    0

    Convert Python to PHP


    I need help in converting the code below to PHP from Python.

    What I am doing is using Scanlife scanner module to scan a barcode and capture the resulting data so that I can do a mysql lookup to display info related the upc. Thank you for any help as I am not familiar enough with Python to understand.


    try{
    // Launch ScanLife
    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("scanlife://sdk/scan"));
    intent.setData(uri);
    startActivity(intent);
    }catch(ActivityNotFoundException ex){
    // Launch the Download of ScanLife
    new AlertDialog.Builder(this)
    .setTitle("Install ScanLife?")
    .setMessage("The application requires ScanLife Barcode Scanner. Would you like to install it?")
    .setPositiveButton("Yes", new DialogInterface.OnClickListener(){
    public void onClick(DialogInterface dg, int v){
    Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse("market://details?id=com.ScanLife"));
    startActivity(intent);
    }
    })
    .setNegativeButton("No", new DialogInterface.OnClickListener(){
    public void onClick(DialogInterface dg, int v){
    }
    })
    .show();
    }catch(Exception ex){
    }
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Location
    Minneapolis, MN
    Posts
    356
    Rep Power
    12
    Hmmmm, that looks like Java, not Python.
    badger badger badger badger
    badger badger badger badger
    MUSHROOM MUSHROOM

IMN logo majestic logo threadwatch logo seochat tools logo