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

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript