Can I Run .vcf File With adb & C#Android - Importing contacts through vCards via ADBHow do I calculate someone's age in C#?What is the difference between String and string in C#?Hidden Features of C#?Cast int to enum in C#Is there a way to run Python on Android?How do I enumerate an enum in C#?How do I create an Excel (.XLS and .XLSX) file in C# without installing Microsoft Office?What are the correct version numbers for C#?Why is the Android emulator so slow? How can we speed up the Android emulator?How can I connect to Android with ADB over TCP?
How can I implement regular expressions on an embedded device?
Why there are construction cranes on apparently completed buildings in New York?
Fantasy Military Arms and Armor: the Dwarven Grand Armory
Solve the given inequality below in the body.
Shoes for commuting
How do I make my fill-in-the-blank exercise more obvious?
Is mathematics truth?
Left my gmail logged in when I was fired
First Number to Contain Each Letter
Is there any reason to change the ISO manually?
Where on Earth is it easiest to survive in the wilderness?
How were the names on the memorial stones in Avengers: Endgame chosen, out-of-universe?
How does the UK House of Commons think they can prolong the deadline of Brexit?
ASCII Maze Rendering 3000
Was "The Hobbit" ever abridged?
Is directly echoing the user agent in PHP a security hole?
GFI outlets tripped after power outage
How can I oppose my advisor granting gift authorship to a collaborator?
How do I anonymously report the Establishment Clause being broken?
Round away from zero
Draw the ☣ (Biohazard Symbol)
Does POSIX guarantee the paths to any standard utilities?
Do 643,000 Americans go bankrupt every year due to medical bills?
Why are all volatile liquids combustible
Can I Run .vcf File With adb & C#
Android - Importing contacts through vCards via ADBHow do I calculate someone's age in C#?What is the difference between String and string in C#?Hidden Features of C#?Cast int to enum in C#Is there a way to run Python on Android?How do I enumerate an enum in C#?How do I create an Excel (.XLS and .XLSX) file in C# without installing Microsoft Office?What are the correct version numbers for C#?Why is the Android emulator so slow? How can we speed up the Android emulator?How can I connect to Android with ADB over TCP?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I pushed a .vcf file from my PC to Android device; I want to run this file and import all contacts to the device using adb shell.
This is my C# function:
private void adbcommand (string command)
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.FileName = @"D:ADBadb.exe";
startInfo.Arguments = command;
process.StartInfo = startInfo;
process.Start();
Console.WriteLine(process.StandardOutput.ReadToEnd());
process.Close();
c#

add a comment |
I pushed a .vcf file from my PC to Android device; I want to run this file and import all contacts to the device using adb shell.
This is my C# function:
private void adbcommand (string command)
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.FileName = @"D:ADBadb.exe";
startInfo.Arguments = command;
process.StartInfo = startInfo;
process.Start();
Console.WriteLine(process.StandardOutput.ReadToEnd());
process.Close();
c#

i want to import vcf file in my phone no't in my c# project,
– Mohammad S. Dayoub
Mar 27 at 21:38
stackoverflow.com/questions/23488290/…
– maytham-ɯɐɥʇʎɐɯ
Mar 27 at 21:52
add a comment |
I pushed a .vcf file from my PC to Android device; I want to run this file and import all contacts to the device using adb shell.
This is my C# function:
private void adbcommand (string command)
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.FileName = @"D:ADBadb.exe";
startInfo.Arguments = command;
process.StartInfo = startInfo;
process.Start();
Console.WriteLine(process.StandardOutput.ReadToEnd());
process.Close();
c#

I pushed a .vcf file from my PC to Android device; I want to run this file and import all contacts to the device using adb shell.
This is my C# function:
private void adbcommand (string command)
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.FileName = @"D:ADBadb.exe";
startInfo.Arguments = command;
process.StartInfo = startInfo;
process.Start();
Console.WriteLine(process.StandardOutput.ReadToEnd());
process.Close();
c#

c#

edited Mar 28 at 3:29
Noah Wilder
5776 silver badges19 bronze badges
5776 silver badges19 bronze badges
asked Mar 27 at 21:28
Mohammad S. DayoubMohammad S. Dayoub
63 bronze badges
63 bronze badges
i want to import vcf file in my phone no't in my c# project,
– Mohammad S. Dayoub
Mar 27 at 21:38
stackoverflow.com/questions/23488290/…
– maytham-ɯɐɥʇʎɐɯ
Mar 27 at 21:52
add a comment |
i want to import vcf file in my phone no't in my c# project,
– Mohammad S. Dayoub
Mar 27 at 21:38
stackoverflow.com/questions/23488290/…
– maytham-ɯɐɥʇʎɐɯ
Mar 27 at 21:52
i want to import vcf file in my phone no't in my c# project,
– Mohammad S. Dayoub
Mar 27 at 21:38
i want to import vcf file in my phone no't in my c# project,
– Mohammad S. Dayoub
Mar 27 at 21:38
stackoverflow.com/questions/23488290/…
– maytham-ɯɐɥʇʎɐɯ
Mar 27 at 21:52
stackoverflow.com/questions/23488290/…
– maytham-ɯɐɥʇʎɐɯ
Mar 27 at 21:52
add a comment |
1 Answer
1
active
oldest
votes
private void button4_Click(object sender, EventArgs e)
adbcommand("shell pm clear com.android.providers.contacts");
adbcommand("shell mkdir /sdcard/contacts/");
string contactsFilePath = @"D:mycontact.vcf";
adbcommand("push "+ contactsFilePath + " /sdcard/contacts/");
adbcommand("shell am start -t text/x-vcard -d file:///sdcard/contacts/mycontact.vcf -a android.intent.action.VIEW com.android.contacts");
private void adbcommand (string command)
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.FileName = @"D:ADBadb.exe";
startInfo.Arguments = command;
process.StartInfo = startInfo;
process.Start();
Console.WriteLine(process.StandardOutput.ReadToEnd());
process.Close();
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55386729%2fcan-i-run-vcf-file-with-adb-c-sharp%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
private void button4_Click(object sender, EventArgs e)
adbcommand("shell pm clear com.android.providers.contacts");
adbcommand("shell mkdir /sdcard/contacts/");
string contactsFilePath = @"D:mycontact.vcf";
adbcommand("push "+ contactsFilePath + " /sdcard/contacts/");
adbcommand("shell am start -t text/x-vcard -d file:///sdcard/contacts/mycontact.vcf -a android.intent.action.VIEW com.android.contacts");
private void adbcommand (string command)
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.FileName = @"D:ADBadb.exe";
startInfo.Arguments = command;
process.StartInfo = startInfo;
process.Start();
Console.WriteLine(process.StandardOutput.ReadToEnd());
process.Close();
add a comment |
private void button4_Click(object sender, EventArgs e)
adbcommand("shell pm clear com.android.providers.contacts");
adbcommand("shell mkdir /sdcard/contacts/");
string contactsFilePath = @"D:mycontact.vcf";
adbcommand("push "+ contactsFilePath + " /sdcard/contacts/");
adbcommand("shell am start -t text/x-vcard -d file:///sdcard/contacts/mycontact.vcf -a android.intent.action.VIEW com.android.contacts");
private void adbcommand (string command)
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.FileName = @"D:ADBadb.exe";
startInfo.Arguments = command;
process.StartInfo = startInfo;
process.Start();
Console.WriteLine(process.StandardOutput.ReadToEnd());
process.Close();
add a comment |
private void button4_Click(object sender, EventArgs e)
adbcommand("shell pm clear com.android.providers.contacts");
adbcommand("shell mkdir /sdcard/contacts/");
string contactsFilePath = @"D:mycontact.vcf";
adbcommand("push "+ contactsFilePath + " /sdcard/contacts/");
adbcommand("shell am start -t text/x-vcard -d file:///sdcard/contacts/mycontact.vcf -a android.intent.action.VIEW com.android.contacts");
private void adbcommand (string command)
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.FileName = @"D:ADBadb.exe";
startInfo.Arguments = command;
process.StartInfo = startInfo;
process.Start();
Console.WriteLine(process.StandardOutput.ReadToEnd());
process.Close();
private void button4_Click(object sender, EventArgs e)
adbcommand("shell pm clear com.android.providers.contacts");
adbcommand("shell mkdir /sdcard/contacts/");
string contactsFilePath = @"D:mycontact.vcf";
adbcommand("push "+ contactsFilePath + " /sdcard/contacts/");
adbcommand("shell am start -t text/x-vcard -d file:///sdcard/contacts/mycontact.vcf -a android.intent.action.VIEW com.android.contacts");
private void adbcommand (string command)
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.FileName = @"D:ADBadb.exe";
startInfo.Arguments = command;
process.StartInfo = startInfo;
process.Start();
Console.WriteLine(process.StandardOutput.ReadToEnd());
process.Close();
answered Mar 29 at 15:24
Mohammad S. DayoubMohammad S. Dayoub
63 bronze badges
63 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55386729%2fcan-i-run-vcf-file-with-adb-c-sharp%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
i want to import vcf file in my phone no't in my c# project,
– Mohammad S. Dayoub
Mar 27 at 21:38
stackoverflow.com/questions/23488290/…
– maytham-ɯɐɥʇʎɐɯ
Mar 27 at 21:52