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;








1















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();










share|improve this question


























  • 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

















1















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();










share|improve this question


























  • 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













1












1








1








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();










share|improve this question
















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# android adb contacts vcf






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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

















  • 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












1 Answer
1






active

oldest

votes


















0
















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();








share|improve this answer
























    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
    );



    );













    draft saved

    draft discarded


















    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









    0
















    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();








    share|improve this answer





























      0
















      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();








      share|improve this answer



























        0














        0










        0









        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();








        share|improve this answer













        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();









        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 29 at 15:24









        Mohammad S. DayoubMohammad S. Dayoub

        63 bronze badges




        63 bronze badges





















            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.



















            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

            155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

            해남서초등학교 학교 연혁 학교 동문 외부 링크 둘러보기 메뉴북위 34° 34′ 21″ 동경 126° 35′ 50″ / 북위 34.5726385° 동경 126.5972670°  / 34.5726385; 126.5972670해남서초등학교eh