As I can translate this ActivityStarter for app inventor?

94 views
Skip to first unread message

Leonel Lopez

unread,
Jan 2, 2016, 12:44:46 PM1/2/16
to MIT App Inventor Forum

As I can translate this ActivityStarter for app inventor?


public void onClick(View v) 
{
Intent intent = new Intent();
intent.setAction(Intent.ACTION_PICK);
// SMB URL (Starts smb:// followed by hostname and port).
Uri smbUri = Uri.parse("smb://192.168.20.128");
intent.setDataAndType(smbUri, "vnd.android.cursor.dir/lysesoft.andsmb.uri");
// Upload
intent.putExtra("command_type", "upload");
// SMB credentials (optional)
intent.putExtra("smb_username", "guest");
//intent.putExtra("smb_password", "yourpassword");
//intent.putExtra("smb_domain", "YOURDOMAIN");
// SMB settings (optional)
//intent.putExtra("smb_encoding", "UTF-8");
// Activity title
intent.putExtra("progress_title", "Uploading files ...");
intent.putExtra("local_file1", "/sdcard/subfolder1/file1.zip");
intent.putExtra("local_file2", "/sdcard/subfolder2/file2.zip");
// Optional initial remote folder (it must exist before upload)
intent.putExtra("remote_folder", "/remotefolder/subfolder");
//intent.putExtra("close_ui", "true");
startActivityForResult(intent, UPLOAD_FILES_REQUEST);

Taifun

unread,
Jan 2, 2016, 3:39:24 PM1/2/16
to MIT App Inventor Forum
that might be possible
meanwhile you also can use several key values pairs in the new Extras property like this

// SMB credentials (optional)
intent.putExtra("smb_username", "guest");
//intent.putExtra("smb_password", "yourpassword");

Leonel Lopez

unread,
Jan 3, 2016, 11:36:56 AM1/3/16
to MIT App Inventor Forum
Muchas gracias Taifun, es usted un genio!!!
Reply all
Reply to author
Forward
0 new messages