Code Monkey home page Code Monkey logo

myphone's People

Contributors

bestowl avatar jxpsert avatar skirky3605 avatar xtremehpx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

myphone's Issues

Plans for MyPhone

I really like the concept of what you're going for with MyPhone. I was wondering if you plan to add screen mirroring and support for opening apps on Windows. The PhoneLink app has support for this, but it's limited to a couple of flagship phones.

Use mic on phone

I am using MyPhone with ios, is there any way to use the mic on my iPhone instead of the mic from my PC during calls?

Could not open the UWP App: System.IO.FileLoadException

I compile successfully according to the description in Readme.md, but an exception is thrown after clicking open app after running

“MyPhone.exe”(CoreCLR: DefaultDomain): 已加载“C:\Program Files\WindowsApps\Microsoft.NET.CoreRuntime.2.2_2.2.29713.2_x64__8wekyb3d8bbwe\System.Private.CoreLib.dll”。
“MyPhone.exe”(CoreCLR: CoreCLR_UWP_Domain): 已加载“D:\VSWrokspace\MyPhone\PackageProject\bin\x64\Debug\AppX\entrypoint\MyPhone.exe”。已加载符号。
“MyPhone.exe”(CoreCLR: CoreCLR_UWP_Domain): 已加载“D:\VSWrokspace\MyPhone\PackageProject\bin\x64\Debug\AppX\System.Runtime.dll”。
“MyPhone.exe”(CoreCLR: CoreCLR_UWP_Domain): 已加载“D:\VSWrokspace\MyPhone\PackageProject\bin\x64\Debug\AppX\WinMetadata\Windows.winmd”。模块已生成,不包含符号。
“MyPhone.exe”(CoreCLR: CoreCLR_UWP_Domain): 已加载“C:\Program Files\WindowsApps\Microsoft.NET.CoreFramework.Debug.2.2_2.2.29301.2_x64__8wekyb3d8bbwe\mscorlib.dll”。
“MyPhone.exe”(CoreCLR: CoreCLR_UWP_Domain): 已加载“D:\VSWrokspace\MyPhone\PackageProject\bin\x64\Debug\AppX\System.Runtime.InteropServices.WindowsRuntime.dll”。
“MyPhone.exe”(CoreCLR: CoreCLR_UWP_Domain): 已加载“C:\Program Files\WindowsApps\Microsoft.NET.CoreFramework.Debug.2.2_2.2.29301.2_x64__8wekyb3d8bbwe\System.Runtime.WindowsRuntime.dll”。
引发的异常:“System.IO.FileLoadException”(位于 MyPhone.exe 中)
“System.IO.FileLoadException”类型的异常在 MyPhone.exe 中发生,但未在用户代码中进行处理
Could not load file or assembly 'System.Runtime.InteropServices.WindowsRuntime, Version=4.0.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I am a novice developer of win. After Google search, I found that there may be a version conflict. The version specified in the package reference is inconsistent with the local installation, but I don't know how to locate and solve the problem. I hope to get your guidance. Thank you!
I found that you are a Chinese, if it is convenient, I can trouble you to communicate in Chinese. Hope to receive your reply!

Direct Access to SCO Audio Streams

Hello, I am struggling to find a solution to access the Raw Audio Packets either in some other codecs or PCM format with the help of 32feet .NET Library I am able to dial/receive the calls via my Android Phone. But needs a way to access the Audio Stream so I can directly play some recorded sound files back to the caller automatically on call answer. But Windows 10 Bluetooth Drivers handle the SCO Connection within the driver. It will be great if you can help in getting the access to the Audio Packets/Stream someway either by the Default Microsoft Bluetooth Driver or some other custom simple driver giving SCO Connection access to the User-Space Application.

USB cable support

In the future, it would be great if you could implement USB cable support in addition to Bluetooth. Not everyone has a Bluetooth adapter on their desktop PCs, but everyone has a USB cable. Just a suggestion. Great project!

Unable to build on Windows 11

I have tried these steps,

image

Getting this error

MSB4018: The task failed unexpectedly

image

Can you please help me with the steps to resolve this?

Publish Releases

Hi, I am having trouble building this app. It would be great if you could publish a release :)

Can you add a release or re-run Github Actions?

Hey there!
Can you re-run the github actions? Because the last artifact is not available (expired).
It would be could to save the generated file somewhere for future users too :)

And thank you for your work!

Support for multiple numbers & devices

Having multiple phones with multiple SIM cards in each can be a burden. The ability to link and use multiple phones would be very useful.

With that in mind I would suggest, when

  • calling a contact, let the user choose the SIM to call with, or either use
    • the last SIM the contact was called with
    • the SIM corresponding to the phone the contact is stored in
  • in a call, allow to add other contacts to the call, if supported by the phone (VoIP/VoLTE?)
  • viewing the contacts
    • display them in a list or grid, either
      • on one single page
      • in a tabination (per phone)
    • order them grouped by their respecting phones or vCard groups
  • managing contacts, allow to transfer them between phones

Grouping by vCard groups is something I have never seen anywhere before, I wonder why.

Looking forward to the first release! For a long, long time I'm hoping for such a project to arise!

Why call audio not transferred to PC when making calls with Handsfree profile?

I'm a newby for bluetooth integration.
I'm trying to build a simple windows form application that connect bluetooth with an Android phone.
I can connect the bluetooth using the handsfree profile and can send AT commands to make a call and answer a call but the problem is that the call audio is not transferred to my PC.

I built my windows app based on the project "MyPhone.Demo.HFP" under "MyPhone.Demo" solution.

Can you guys explain me why and how can I solve this?

Where is the .exe?

yes i really want to use this app how do i find the exe file or if its not an exe file where do you ahve exact instructions how to install this
PLEASE HELP

Not able to run the sample on windows 10 desktop

Is there step missing to have this run on regular windows desktop?

According to MS, PhoneLineTransportDevice class only applies to WinRT Build 18362, Build 19041, Build 20348, Build 22000 (Preview)
https://docs.microsoft.com/en-us/uwp/api/windows.applicationmodel.calls.phonelinetransportdevice?view=winrt-20348

Not Implemented exception was thrown here:

Feature com.microsoft.windows.applicationmodel.phonelinetransportdevice_v1 is not available
Source=
StackTrace:

at Windows.ApplicationModel.Calls.PhoneLineTransportDevice.GetDeviceSelector(PhoneLineTransport transport)
at GoodTimeStudio.MyPhone.Models.BluetoothDeviceListViewModel..ctor() in C:\repos\MyPhone\MyPhone\Models\BluetoothDeviceListViewModel.cs:line 28
at GoodTimeStudio.MyPhone.BluetoothDeviceListView..ctor() in C:\repos\MyPhone\MyPhone\BluetoothDeviceListView.xaml.cs:line 29

MAP demo doesn't work with iPhone

MAP demo does not seem to work with iPhone but Android Phone seems to work. Any suggestions?

System: Windows 10 Pro, 19042.110 Build + iPhone 11

iPhone Log:

 Selected: X’s iPhone    Bluetooth#Bluetooth30:e3:7a:62:d5:67-60:83:73:83:12:a6

Available RFComm services for this devices:
Bluetooth#Bluetooth30:e3:7a:62:d5:67-60:83:73:83:12:a6#RFCOMM:00000000:{00001132-0000-1000-8000-00805f9b34fb}
Bluetooth#Bluetooth30:e3:7a:62:d5:67-60:83:73:83:12:a6#RFCOMM:00000000:{02030302-1d19-415f-86f2-22a2106a0a77}
Bluetooth#Bluetooth30:e3:7a:62:d5:67-60:83:73:83:12:a6#RFCOMM:00000000:{00000000-deca-fade-deca-deafdecacafe}
Bluetooth#Bluetooth30:e3:7a:62:d5:67-60:83:73:83:12:a6#RFCOMM:00000000:{0000112f-0000-1000-8000-00805f9b34fb}
Bluetooth#Bluetooth30:e3:7a:62:d5:67-60:83:73:83:12:a6#RFCOMM:00000000:{0000111f-0000-1000-8000-00805f9b34fb}
Connecting...
80-00-1A-10-00-FF-FF-46-00-13-BB-58-2B-40-42-0C-11-DB-B0-DE-08-00-20-0C-9A-66
Returned package:
Opcode: Success
A0-00-32-10-00-0F-A0-46-00-13-BB-58-2B-40-42-0C-11-DB-B0-DE-08-00-20-0C-9A-66-CB-90-5D-20-07-4A-00-13-BB-58-2B-40-42-0C-11-DB-B0-DE-08-00-20-0C-9A-66
MNS: Start advertising MNS service
Wait for 1 seconds
MNS: Sending
82-00-4A-CB-00-00-00-01-42-00-25-78-2D-62-74-2F-4D-41-50-2D-4E-6F-74-69-66-69-63-61-74-69-6F-6E-52-65-67-69-73-74-72-61-74-69-6F-6E-00-4C-00-06-0E-01-01-48-00-04-30-46-00-13-BB-58-2B-40-42-0C-11-DB-B0-DE-08-00-20-0C-9A-66
Opcode: PutAlter
Returned packet:
D3-00-03
Opcode: 211
MNS: Failed to call SetNotificationRegistration
Enter any key to exit...

Android Log

Selected: Pixel 2 XL    Bluetooth#Bluetooth30:e3:7a:62:d5:67-08:d4:6a:1a:b4:e9

Available RFComm services for this devices:
Bluetooth#Bluetooth30:e3:7a:62:d5:67-08:d4:6a:1a:b4:e9#RFCOMM:00000000:{00001112-0000-1000-8000-00805f9b34fb}
Bluetooth#Bluetooth30:e3:7a:62:d5:67-08:d4:6a:1a:b4:e9#RFCOMM:00000000:{0000111f-0000-1000-8000-00805f9b34fb}
Bluetooth#Bluetooth30:e3:7a:62:d5:67-08:d4:6a:1a:b4:e9#RFCOMM:00000000:{00001132-0000-1000-8000-00805f9b34fb}
Bluetooth#Bluetooth30:e3:7a:62:d5:67-08:d4:6a:1a:b4:e9#RFCOMM:00000000:{0000112f-0000-1000-8000-00805f9b34fb}
Bluetooth#Bluetooth30:e3:7a:62:d5:67-08:d4:6a:1a:b4:e9#RFCOMM:00000000:{00001105-0000-1000-8000-00805f9b34fb}
Bluetooth#Bluetooth30:e3:7a:62:d5:67-08:d4:6a:1a:b4:e9#RFCOMM:00000000:{0000112d-0000-1000-8000-00805f9b34fb}
Connecting...
80-00-1A-10-00-FF-FF-46-00-13-BB-58-2B-40-42-0C-11-DB-B0-DE-08-00-20-0C-9A-66
Returned package:
Opcode: Success
A0-00-32-10-00-FF-FE-46-00-13-BB-58-2B-40-42-0C-11-DB-B0-DE-08-00-20-0C-9A-66-CB-01-00-00-00-4A-00-13-BB-58-2B-40-42-0C-11-DB-B0-DE-08-00-20-0C-9A-66
MNS: Start advertising MNS service
Wait for 1 seconds
MNS: Sending
82-00-4A-CB-00-00-00-01-42-00-25-78-2D-62-74-2F-4D-41-50-2D-4E-6F-74-69-66-69-63-61-74-69-6F-6E-52-65-67-69-73-74-72-61-74-69-6F-6E-00-4C-00-06-0E-01-01-48-00-04-30-46-00-13-BB-58-2B-40-42-0C-11-DB-B0-DE-08-00-20-0C-9A-66
Opcode: PutAlter
Returned packet:
A0-00-08-CB-01-00-00-00
Opcode: Success
Enter any key to exit...
Connection received
Stoping Advertising
Opcode: Connect

Unhandled exception. System.AggregateException: One or more errors occurred. (A method was called at an unexpected time. (0x8000000E))
 ---> System.InvalidOperationException: A method was called at an unexpected time. (0x8000000E)
   at Windows.Devices.Bluetooth.Rfcomm.RfcommServiceProvider.StopAdvertising()
   at MyPhone.Demo.MAP.Do() in D:\work\git\MyPhone\MyPhone.Demo\MAP.cs:line 84
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at MyPhone.Demo.MAP.Main(String[] args) in D:\work\git\MyPhone\MyPhone.Demo\MAP.cs:line 42

PhoneLineTransportDevice API no longer works on Windows 22H2

Recently I discovered that starting Windows 11 22H2 (build 22621), PhoneLineTransportDevice API no longer works, which resulted in our app's Calling feature no longer working.

The Calling feature currently relies on the PhoneLineTransportDevice API. The following is a brief description of how to use this API:

  1. Enumerate a PhoneLineTransportDevice using either the DeviceWatcher or DeviceInformation.
  2. Call PhoneLineTransportDevice.RegisterApp() to register the app with Windows for the associated PhoneLineTransportDevice.
  3. Call PhoneLineTransportDevice.ConnectAsync().
  4. Use PhoneLineWatcher to enumerate PhoneLine, similar to the DeviceWatcher.
  5. Call PhoneLine.Dial()
    Note: Microsoft's Your Phone (now called Phone Link) uses the same mechanism to implement the Calling feature as of 2020, not sure for now.

However, after upgrading to Windows 11 22H2 (build 22621), calling PhoneLineTransportDevice.RegisterApp() either results in non-functional or throws a System.UnauthorizedAccessException, even though PhoneLineTransportDevice.RequestAccessAsync() returns "Allowed".

I tested Phone Link on my PC and verified that it works without any issues. Therefore, I am not sure why our app is experiencing this problem.

I am seeking assistance in resolving this issue. If the PhoneLineTransportDevice API is no longer usable, I am open to suggestions for alternative solutions.

two phones connected ?

I'm discovering your code and it looks very promising for a project I have.

I have set up two BT connections on the same computer to two different phones.
Running your program I use phone #1 to call phone #2 ... and your program emits a notification for phone #2 receiving a call ... how weird, I thought that your app was connected to phone #1 only ... is this a bug ?

Is it possible to use your library for Win32 desktop appplications ?

I hope you can find the time to continue the development, notably for SMS messaging.

TransportDevice.ConnectAsync() not working on Windows Form application.

I've tried to follow the codes in project "MyPhone" which is an UWP app to build a Windows Form app for making phone call.
I've stuck in a trouble where TransportDevice.ConnectAsync() always returns 'false', so phone line cannot be initialed.
Can anyone explain or guide me to the correct implementation of Windows Form?

Here are my codes:

protected override async Task<bool> ConnectToServiceAsync()
{
    var accessResult = await TransportDevice.RequestAccessAsync();
    if (accessResult == Windows.Devices.Enumeration.DeviceAccessStatus.Allowed)
    {
        //_logger.LogInformation("PhoneLineTransportDevice access granted");
    }
    else
    {
        //_logger.LogWarning("PhoneLineTransportDevice access denied, reason: {Reason}, contine anyway", accessResult);
    }

    if (!TransportDevice.IsRegistered())
    {
        //_logger.LogInformation("PhoneLineTransportDevice not registered, registering.");
        TransportDevice.RegisterApp();
    }
    //_logger.LogInformation("PhoneLineTransportDevice registered.");

    bool success = await TransportDevice.ConnectAsync();
    if (success)
    {
        //_logger.LogInformation("CallService connected.");
        //_logger.LogInformation("Initiate PhoneLine auto discovery.");
        _taskInitPhoneLine = InitPhoneLine();
    }
    else
    {
        //_taskInitPhoneLine = InitPhoneLine();
    }
    return success;
}

Incoming call handle

Hi.
I want to handle incoming call to display customer's informations in our crm. Is there any api can do that?
When i use
var result = await BTDevice.GetRfcommServicesForIdAsync(RfcommServiceId.FromUuid( new Guid("0000111F-0000-1000-8000-00805F9B34FB")),BluetoothCacheMode.Uncached);

            if (result.Services.Count > 0)
            {
                BTService = result.Services[0];
                var status = await BTService.RequestAccessAsync();
                BTSocket = new StreamSocket();
                await BTSocket.ConnectAsync(BTService.ConnectionHostName, BTService.ConnectionServiceName,
                    SocketProtectionLevel.BluetoothEncryptionAllowNullAuthentication);

                _writer = new DataWriter(BTSocket.OutputStream);
                _reader = new DataReader(BTSocket.InputStream);

                return true;
            }
            else
            {
                Debug.WriteLine("This device does not support HFP");
                return false;
            }

I has an error 'DeniedBySystem'

Thanks you.

iphone support

I've built the app, but iphone doesnt work at all with it. Iphone 6s with 15.6.1 ios.
I tried oneplus 7 pro as well. calls did not work.

Migrating to Windows App SDK (WinUI 3)

TL;DR

We are planning to refactor and migrate from UWP to Windows App SDK desktop app

Current Architecture

Currently, the main UI is a UWP app, which causes some trouble to implement the messaging feature.

Project Type Description
MyPhone.TrayApp.XamlHost C++ UWP Project XAML island host
MyPhone.TrayApp C++ Win32 Project Main app logic, system tray UI and UWP "broker". Enable the UWP app to call Win32 APIs and keeping the app running in the background. Use XAML island to make the system tray UI has the same look and feel as native UWP system apps. This project handles main app logic including Bluetooth HFP stuff.
MyPhone C# UWP Project Main app UI
PackageProject Desktop Bridge Packaging Project Generate MSIX app package

Problem: UWP background restriction.

In order to receive message notification from MCE (mobile phone), the MNS server needs to keep running in the background and keep connected to the MCE. Being a UWP app makes it "impossible" to do that because a UWP app cannot run in the background for a long time. A common method to bypass this restriction is to put the server in a Win32 broker process (like MyPhone.TrayApp) so that it can run in the background indefinitely, and then pass the message content to the UWP UI. But passing a huge amount of data between two processes may cause both development overhead and runtime performance overhead because you need to handle Inter-Process Communication (IPC).

Why we chose UWP?

We want to use the WinUI library to match the look and feel with the system. Back to the time when this project was started, there are only two ways to use WinUI.

  1. UWP
  2. XAML Island (Attach UWP UI in a Win32 process)

Although we can use XAML Island at that time, some important dev tools are missing (such as XAML hot reload, XAML designer, etc.). Thus UWP was the primary choice.

New Architecture

With the release of Windows App SDK 1.0, the use of UWP has become meaningless.

  1. The primary use case of this app is to use it on a desktop or laptop PC. Who would try to use this app on a Windows Phone to make phone calls via another phone's cellular network?
  2. Being a desktop app simplifies everything. No need to use "broker" anymore; no complicated IPC handling. We can keep everything in one single process.

Therefore, we are planning to migrate this project from UWP to Windows App SDK.

Project Type Description
MyPhone C# Windows App SDK Project Main UI, tray icon, background server, and everything else, all in one process
PackageProject Desktop Bridge Packaging Project Generate MSIX app package

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.