├── .gitignore ├── EasyChat ├── .gitattributes ├── .gitignore ├── EasyChat.sln └── EasyChat │ ├── EasyChat.Android │ ├── Assets │ │ └── AboutAssets.txt │ ├── EasyChat.Android.csproj │ ├── MainActivity.cs │ ├── MainApplication.cs │ ├── Properties │ │ ├── AndroidManifest.xml │ │ └── AssemblyInfo.cs │ ├── Resources │ │ ├── AboutResources.txt │ │ ├── Resource.Designer.cs │ │ ├── drawable-hdpi │ │ │ └── icon.png │ │ ├── drawable-xhdpi │ │ │ └── icon.png │ │ ├── drawable-xxhdpi │ │ │ └── icon.png │ │ ├── drawable │ │ │ └── icon.png │ │ ├── layout │ │ │ ├── Tabbar.axml │ │ │ └── Toolbar.axml │ │ └── values │ │ │ └── styles.xml │ └── packages.config │ ├── EasyChat.iOS │ ├── AppDelegate.cs │ ├── EasyChat.iOS.csproj │ ├── Entitlements.plist │ ├── Info.plist │ ├── Main.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Resources │ │ ├── Default-568h@2x.png │ │ ├── Default-Portrait.png │ │ ├── Default-Portrait@2x.png │ │ ├── Default.png │ │ ├── Default@2x.png │ │ ├── Icon-60@2x.png │ │ ├── Icon-60@3x.png │ │ ├── Icon-76.png │ │ ├── Icon-76@2x.png │ │ ├── Icon-Small-40.png │ │ ├── Icon-Small-40@2x.png │ │ ├── Icon-Small-40@3x.png │ │ ├── Icon-Small.png │ │ ├── Icon-Small@2x.png │ │ ├── Icon-Small@3x.png │ │ └── LaunchScreen.storyboard │ ├── iTunesArtwork │ ├── iTunesArtwork@2x │ └── packages.config │ └── EasyChat │ ├── App.xaml │ ├── App.xaml.cs │ ├── ChatDataTemplateSelector.cs │ ├── ChatPage.xaml │ ├── ChatPage.xaml.cs │ ├── ChatPageViewModel.cs │ ├── CustomCells │ ├── IncomingViewCell.xaml │ ├── IncomingViewCell.xaml.cs │ ├── OutgoingViewCell.xaml │ └── OutgoingViewCell.xaml.cs │ ├── EasyChat.projitems │ ├── EasyChat.shproj │ ├── MainPage.xaml │ ├── MainPage.xaml.cs │ └── Message.cs ├── README.md └── service ├── EasyChatService.cs ├── Program.cs ├── Properties └── launchSettings.json ├── Readme.md ├── Startup.cs └── easychat.csproj /.gitignore: -------------------------------------------------------------------------------- 1 | easychat.csproj.user 2 | ## Ignore Visual Studio temporary files, build results, and 3 | ## files generated by popular Visual Studio add-ons. 4 | 5 | # User-specific files 6 | *.suo 7 | *.user 8 | *.userosscache 9 | *.sln.docstates 10 | *.vscode 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # MSTest test Results 33 | [Tt]est[Rr]esult*/ 34 | [Bb]uild[Ll]og.* 35 | 36 | # NUNIT 37 | *.VisualState.xml 38 | TestResult.xml 39 | 40 | # Build Results of an ATL Project 41 | [Dd]ebugPS/ 42 | [Rr]eleasePS/ 43 | dlldata.c 44 | 45 | # DNX 46 | project.lock.json 47 | project.fragment.lock.json 48 | artifacts/ 49 | 50 | *_i.c 51 | *_p.c 52 | *_i.h 53 | *.ilk 54 | *.meta 55 | *.obj 56 | *.pch 57 | *.pdb 58 | *.pgc 59 | *.pgd 60 | *.rsp 61 | *.sbr 62 | *.tlb 63 | *.tli 64 | *.tlh 65 | *.tmp 66 | *.tmp_proj 67 | *.log 68 | *.vspscc 69 | *.vssscc 70 | .builds 71 | *.pidb 72 | *.svclog 73 | *.scc 74 | 75 | # Chutzpah Test files 76 | _Chutzpah* 77 | 78 | # Visual C++ cache files 79 | ipch/ 80 | *.aps 81 | *.ncb 82 | *.opendb 83 | *.opensdf 84 | *.sdf 85 | *.cachefile 86 | *.VC.db 87 | *.VC.VC.opendb 88 | 89 | # Visual Studio profiler 90 | *.psess 91 | *.vsp 92 | *.vspx 93 | *.sap 94 | 95 | # TFS 2012 Local Workspace 96 | $tf/ 97 | 98 | # Guidance Automation Toolkit 99 | *.gpState 100 | 101 | # ReSharper is a .NET coding add-in 102 | _ReSharper*/ 103 | *.[Rr]e[Ss]harper 104 | *.DotSettings.user 105 | 106 | # JustCode is a .NET coding add-in 107 | .JustCode 108 | 109 | # TeamCity is a build add-in 110 | _TeamCity* 111 | 112 | # DotCover is a Code Coverage Tool 113 | *.dotCover 114 | 115 | # Visual Studio code coverage results 116 | *.coverage 117 | *.coveragexml 118 | 119 | # NCrunch 120 | _NCrunch_* 121 | .*crunch*.local.xml 122 | nCrunchTemp_* 123 | 124 | # MightyMoose 125 | *.mm.* 126 | AutoTest.Net/ 127 | 128 | # Web workbench (sass) 129 | .sass-cache/ 130 | 131 | # Installshield output folder 132 | [Ee]xpress/ 133 | 134 | # DocProject is a documentation generator add-in 135 | DocProject/buildhelp/ 136 | DocProject/Help/*.HxT 137 | DocProject/Help/*.HxC 138 | DocProject/Help/*.hhc 139 | DocProject/Help/*.hhk 140 | DocProject/Help/*.hhp 141 | DocProject/Help/Html2 142 | DocProject/Help/html 143 | 144 | # Click-Once directory 145 | publish/ 146 | 147 | # Publish Web Output 148 | *.[Pp]ublish.xml 149 | *.azurePubxml 150 | # TODO: Comment the next line if you want to checkin your web deploy settings 151 | # but database connection strings (with potential passwords) will be unencrypted 152 | *.pubxml 153 | *.publishproj 154 | 155 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 156 | # checkin your Azure Web App publish settings, but sensitive information contained 157 | # in these scripts will be unencrypted 158 | PublishScripts/ 159 | 160 | # NuGet Packages 161 | *.nupkg 162 | # The packages folder can be ignored because of Package Restore 163 | **/packages/* 164 | # except build/, which is used as an MSBuild target. 165 | !**/packages/build/ 166 | # Uncomment if necessary however generally it will be regenerated when needed 167 | #!**/packages/repositories.config 168 | # NuGet v3's project.json files produces more ignoreable files 169 | *.nuget.props 170 | *.nuget.targets 171 | 172 | # Microsoft Azure Build Output 173 | csx/ 174 | *.build.csdef 175 | 176 | # Microsoft Azure Emulator 177 | ecf/ 178 | rcf/ 179 | 180 | # Windows Store app package directories and files 181 | AppPackages/ 182 | BundleArtifacts/ 183 | Package.StoreAssociation.xml 184 | _pkginfo.txt 185 | 186 | # Visual Studio cache files 187 | # files ending in .cache can be ignored 188 | *.[Cc]ache 189 | # but keep track of directories ending in .cache 190 | !*.[Cc]ache/ 191 | 192 | # Others 193 | ClientBin/ 194 | ~$* 195 | *~ 196 | *.dbmdl 197 | *.dbproj.schemaview 198 | *.jfm 199 | *.pfx 200 | *.publishsettings 201 | node_modules/ 202 | orleans.codegen.cs 203 | 204 | # Since there are multiple workflows, uncomment next line to ignore bower_components 205 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 206 | #bower_components/ 207 | 208 | # RIA/Silverlight projects 209 | Generated_Code/ 210 | 211 | # Backup & report files from converting an old project file 212 | # to a newer Visual Studio version. Backup files are not needed, 213 | # because we have git ;-) 214 | _UpgradeReport_Files/ 215 | Backup*/ 216 | UpgradeLog*.XML 217 | UpgradeLog*.htm 218 | 219 | # SQL Server files 220 | *.mdf 221 | *.ldf 222 | 223 | # Business Intelligence projects 224 | *.rdl.data 225 | *.bim.layout 226 | *.bim_*.settings 227 | 228 | # Microsoft Fakes 229 | FakesAssemblies/ 230 | 231 | # GhostDoc plugin setting file 232 | *.GhostDoc.xml 233 | 234 | # Node.js Tools for Visual Studio 235 | .ntvs_analysis.dat 236 | 237 | # Visual Studio 6 build log 238 | *.plg 239 | 240 | # Visual Studio 6 workspace options file 241 | *.opt 242 | 243 | # Visual Studio LightSwitch build output 244 | **/*.HTMLClient/GeneratedArtifacts 245 | **/*.DesktopClient/GeneratedArtifacts 246 | **/*.DesktopClient/ModelManifest.xml 247 | **/*.Server/GeneratedArtifacts 248 | **/*.Server/ModelManifest.xml 249 | _Pvt_Extensions 250 | 251 | # Paket dependency manager 252 | .paket/paket.exe 253 | paket-files/ 254 | 255 | # FAKE - F# Make 256 | .fake/ 257 | 258 | # JetBrains Rider 259 | .idea/ 260 | *.sln.iml 261 | 262 | # CodeRush 263 | .cr/ 264 | 265 | # Python Tools for Visual Studio (PTVS) 266 | __pycache__/ 267 | *.pyc 268 | 269 | # Cake - Uncomment if you are using it 270 | # tools/ 271 | 272 | *.db 273 | -------------------------------------------------------------------------------- /EasyChat/.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /EasyChat/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /EasyChat/EasyChat.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26730.16 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "EasyChat", "EasyChat\EasyChat\EasyChat.shproj", "{4C737B85-0C05-4127-BF86-516C160A3C27}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyChat.Android", "EasyChat\EasyChat.Android\EasyChat.Android.csproj", "{C21B2B5B-7439-422C-AE88-D30630426933}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyChat.iOS", "EasyChat\EasyChat.iOS\EasyChat.iOS.csproj", "{C913A816-D238-4F48-BD74-419D82B07904}" 11 | EndProject 12 | Global 13 | GlobalSection(SharedMSBuildProjectFiles) = preSolution 14 | EasyChat\EasyChat\EasyChat.projitems*{0beebf50-69de-4d35-a501-d803c2a1c44d}*SharedItemsImports = 4 15 | EasyChat\EasyChat\EasyChat.projitems*{4c737b85-0c05-4127-bf86-516c160a3c27}*SharedItemsImports = 13 16 | EasyChat\EasyChat\EasyChat.projitems*{c21b2b5b-7439-422c-ae88-d30630426933}*SharedItemsImports = 4 17 | EasyChat\EasyChat\EasyChat.projitems*{c913a816-d238-4f48-bd74-419d82b07904}*SharedItemsImports = 4 18 | EndGlobalSection 19 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 20 | Ad-Hoc|Any CPU = Ad-Hoc|Any CPU 21 | Ad-Hoc|ARM = Ad-Hoc|ARM 22 | Ad-Hoc|iPhone = Ad-Hoc|iPhone 23 | Ad-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator 24 | Ad-Hoc|x64 = Ad-Hoc|x64 25 | Ad-Hoc|x86 = Ad-Hoc|x86 26 | AppStore|Any CPU = AppStore|Any CPU 27 | AppStore|ARM = AppStore|ARM 28 | AppStore|iPhone = AppStore|iPhone 29 | AppStore|iPhoneSimulator = AppStore|iPhoneSimulator 30 | AppStore|x64 = AppStore|x64 31 | AppStore|x86 = AppStore|x86 32 | Debug|Any CPU = Debug|Any CPU 33 | Debug|ARM = Debug|ARM 34 | Debug|iPhone = Debug|iPhone 35 | Debug|iPhoneSimulator = Debug|iPhoneSimulator 36 | Debug|x64 = Debug|x64 37 | Debug|x86 = Debug|x86 38 | Release|Any CPU = Release|Any CPU 39 | Release|ARM = Release|ARM 40 | Release|iPhone = Release|iPhone 41 | Release|iPhoneSimulator = Release|iPhoneSimulator 42 | Release|x64 = Release|x64 43 | Release|x86 = Release|x86 44 | EndGlobalSection 45 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 46 | {C21B2B5B-7439-422C-AE88-D30630426933}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU 47 | {C21B2B5B-7439-422C-AE88-D30630426933}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU 48 | {C21B2B5B-7439-422C-AE88-D30630426933}.Ad-Hoc|Any CPU.Deploy.0 = Release|Any CPU 49 | {C21B2B5B-7439-422C-AE88-D30630426933}.Ad-Hoc|ARM.ActiveCfg = Release|Any CPU 50 | {C21B2B5B-7439-422C-AE88-D30630426933}.Ad-Hoc|ARM.Build.0 = Release|Any CPU 51 | {C21B2B5B-7439-422C-AE88-D30630426933}.Ad-Hoc|ARM.Deploy.0 = Release|Any CPU 52 | {C21B2B5B-7439-422C-AE88-D30630426933}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU 53 | {C21B2B5B-7439-422C-AE88-D30630426933}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU 54 | {C21B2B5B-7439-422C-AE88-D30630426933}.Ad-Hoc|iPhone.Deploy.0 = Release|Any CPU 55 | {C21B2B5B-7439-422C-AE88-D30630426933}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU 56 | {C21B2B5B-7439-422C-AE88-D30630426933}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU 57 | {C21B2B5B-7439-422C-AE88-D30630426933}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Release|Any CPU 58 | {C21B2B5B-7439-422C-AE88-D30630426933}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU 59 | {C21B2B5B-7439-422C-AE88-D30630426933}.Ad-Hoc|x64.Build.0 = Release|Any CPU 60 | {C21B2B5B-7439-422C-AE88-D30630426933}.Ad-Hoc|x64.Deploy.0 = Release|Any CPU 61 | {C21B2B5B-7439-422C-AE88-D30630426933}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU 62 | {C21B2B5B-7439-422C-AE88-D30630426933}.Ad-Hoc|x86.Build.0 = Release|Any CPU 63 | {C21B2B5B-7439-422C-AE88-D30630426933}.Ad-Hoc|x86.Deploy.0 = Release|Any CPU 64 | {C21B2B5B-7439-422C-AE88-D30630426933}.AppStore|Any CPU.ActiveCfg = Release|Any CPU 65 | {C21B2B5B-7439-422C-AE88-D30630426933}.AppStore|Any CPU.Build.0 = Release|Any CPU 66 | {C21B2B5B-7439-422C-AE88-D30630426933}.AppStore|Any CPU.Deploy.0 = Release|Any CPU 67 | {C21B2B5B-7439-422C-AE88-D30630426933}.AppStore|ARM.ActiveCfg = Release|Any CPU 68 | {C21B2B5B-7439-422C-AE88-D30630426933}.AppStore|ARM.Build.0 = Release|Any CPU 69 | {C21B2B5B-7439-422C-AE88-D30630426933}.AppStore|ARM.Deploy.0 = Release|Any CPU 70 | {C21B2B5B-7439-422C-AE88-D30630426933}.AppStore|iPhone.ActiveCfg = Release|Any CPU 71 | {C21B2B5B-7439-422C-AE88-D30630426933}.AppStore|iPhone.Build.0 = Release|Any CPU 72 | {C21B2B5B-7439-422C-AE88-D30630426933}.AppStore|iPhone.Deploy.0 = Release|Any CPU 73 | {C21B2B5B-7439-422C-AE88-D30630426933}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU 74 | {C21B2B5B-7439-422C-AE88-D30630426933}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU 75 | {C21B2B5B-7439-422C-AE88-D30630426933}.AppStore|iPhoneSimulator.Deploy.0 = Release|Any CPU 76 | {C21B2B5B-7439-422C-AE88-D30630426933}.AppStore|x64.ActiveCfg = Release|Any CPU 77 | {C21B2B5B-7439-422C-AE88-D30630426933}.AppStore|x64.Build.0 = Release|Any CPU 78 | {C21B2B5B-7439-422C-AE88-D30630426933}.AppStore|x64.Deploy.0 = Release|Any CPU 79 | {C21B2B5B-7439-422C-AE88-D30630426933}.AppStore|x86.ActiveCfg = Release|Any CPU 80 | {C21B2B5B-7439-422C-AE88-D30630426933}.AppStore|x86.Build.0 = Release|Any CPU 81 | {C21B2B5B-7439-422C-AE88-D30630426933}.AppStore|x86.Deploy.0 = Release|Any CPU 82 | {C21B2B5B-7439-422C-AE88-D30630426933}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 83 | {C21B2B5B-7439-422C-AE88-D30630426933}.Debug|Any CPU.Build.0 = Debug|Any CPU 84 | {C21B2B5B-7439-422C-AE88-D30630426933}.Debug|Any CPU.Deploy.0 = Debug|Any CPU 85 | {C21B2B5B-7439-422C-AE88-D30630426933}.Debug|ARM.ActiveCfg = Debug|Any CPU 86 | {C21B2B5B-7439-422C-AE88-D30630426933}.Debug|ARM.Build.0 = Debug|Any CPU 87 | {C21B2B5B-7439-422C-AE88-D30630426933}.Debug|ARM.Deploy.0 = Debug|Any CPU 88 | {C21B2B5B-7439-422C-AE88-D30630426933}.Debug|iPhone.ActiveCfg = Debug|Any CPU 89 | {C21B2B5B-7439-422C-AE88-D30630426933}.Debug|iPhone.Build.0 = Debug|Any CPU 90 | {C21B2B5B-7439-422C-AE88-D30630426933}.Debug|iPhone.Deploy.0 = Debug|Any CPU 91 | {C21B2B5B-7439-422C-AE88-D30630426933}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU 92 | {C21B2B5B-7439-422C-AE88-D30630426933}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU 93 | {C21B2B5B-7439-422C-AE88-D30630426933}.Debug|iPhoneSimulator.Deploy.0 = Debug|Any CPU 94 | {C21B2B5B-7439-422C-AE88-D30630426933}.Debug|x64.ActiveCfg = Debug|Any CPU 95 | {C21B2B5B-7439-422C-AE88-D30630426933}.Debug|x64.Build.0 = Debug|Any CPU 96 | {C21B2B5B-7439-422C-AE88-D30630426933}.Debug|x64.Deploy.0 = Debug|Any CPU 97 | {C21B2B5B-7439-422C-AE88-D30630426933}.Debug|x86.ActiveCfg = Debug|Any CPU 98 | {C21B2B5B-7439-422C-AE88-D30630426933}.Debug|x86.Build.0 = Debug|Any CPU 99 | {C21B2B5B-7439-422C-AE88-D30630426933}.Debug|x86.Deploy.0 = Debug|Any CPU 100 | {C21B2B5B-7439-422C-AE88-D30630426933}.Release|Any CPU.ActiveCfg = Release|Any CPU 101 | {C21B2B5B-7439-422C-AE88-D30630426933}.Release|Any CPU.Build.0 = Release|Any CPU 102 | {C21B2B5B-7439-422C-AE88-D30630426933}.Release|Any CPU.Deploy.0 = Release|Any CPU 103 | {C21B2B5B-7439-422C-AE88-D30630426933}.Release|ARM.ActiveCfg = Release|Any CPU 104 | {C21B2B5B-7439-422C-AE88-D30630426933}.Release|ARM.Build.0 = Release|Any CPU 105 | {C21B2B5B-7439-422C-AE88-D30630426933}.Release|ARM.Deploy.0 = Release|Any CPU 106 | {C21B2B5B-7439-422C-AE88-D30630426933}.Release|iPhone.ActiveCfg = Release|Any CPU 107 | {C21B2B5B-7439-422C-AE88-D30630426933}.Release|iPhone.Build.0 = Release|Any CPU 108 | {C21B2B5B-7439-422C-AE88-D30630426933}.Release|iPhone.Deploy.0 = Release|Any CPU 109 | {C21B2B5B-7439-422C-AE88-D30630426933}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU 110 | {C21B2B5B-7439-422C-AE88-D30630426933}.Release|iPhoneSimulator.Build.0 = Release|Any CPU 111 | {C21B2B5B-7439-422C-AE88-D30630426933}.Release|iPhoneSimulator.Deploy.0 = Release|Any CPU 112 | {C21B2B5B-7439-422C-AE88-D30630426933}.Release|x64.ActiveCfg = Release|Any CPU 113 | {C21B2B5B-7439-422C-AE88-D30630426933}.Release|x64.Build.0 = Release|Any CPU 114 | {C21B2B5B-7439-422C-AE88-D30630426933}.Release|x64.Deploy.0 = Release|Any CPU 115 | {C21B2B5B-7439-422C-AE88-D30630426933}.Release|x86.ActiveCfg = Release|Any CPU 116 | {C21B2B5B-7439-422C-AE88-D30630426933}.Release|x86.Build.0 = Release|Any CPU 117 | {C21B2B5B-7439-422C-AE88-D30630426933}.Release|x86.Deploy.0 = Release|Any CPU 118 | {C913A816-D238-4F48-BD74-419D82B07904}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhone 119 | {C913A816-D238-4F48-BD74-419D82B07904}.Ad-Hoc|ARM.ActiveCfg = Ad-Hoc|iPhone 120 | {C913A816-D238-4F48-BD74-419D82B07904}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone 121 | {C913A816-D238-4F48-BD74-419D82B07904}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone 122 | {C913A816-D238-4F48-BD74-419D82B07904}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator 123 | {C913A816-D238-4F48-BD74-419D82B07904}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator 124 | {C913A816-D238-4F48-BD74-419D82B07904}.Ad-Hoc|x64.ActiveCfg = Ad-Hoc|iPhone 125 | {C913A816-D238-4F48-BD74-419D82B07904}.Ad-Hoc|x86.ActiveCfg = Ad-Hoc|iPhone 126 | {C913A816-D238-4F48-BD74-419D82B07904}.AppStore|Any CPU.ActiveCfg = AppStore|iPhone 127 | {C913A816-D238-4F48-BD74-419D82B07904}.AppStore|ARM.ActiveCfg = AppStore|iPhone 128 | {C913A816-D238-4F48-BD74-419D82B07904}.AppStore|iPhone.ActiveCfg = AppStore|iPhone 129 | {C913A816-D238-4F48-BD74-419D82B07904}.AppStore|iPhone.Build.0 = AppStore|iPhone 130 | {C913A816-D238-4F48-BD74-419D82B07904}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator 131 | {C913A816-D238-4F48-BD74-419D82B07904}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator 132 | {C913A816-D238-4F48-BD74-419D82B07904}.AppStore|x64.ActiveCfg = AppStore|iPhone 133 | {C913A816-D238-4F48-BD74-419D82B07904}.AppStore|x86.ActiveCfg = AppStore|iPhone 134 | {C913A816-D238-4F48-BD74-419D82B07904}.Debug|Any CPU.ActiveCfg = Debug|iPhone 135 | {C913A816-D238-4F48-BD74-419D82B07904}.Debug|ARM.ActiveCfg = Debug|iPhone 136 | {C913A816-D238-4F48-BD74-419D82B07904}.Debug|iPhone.ActiveCfg = Debug|iPhone 137 | {C913A816-D238-4F48-BD74-419D82B07904}.Debug|iPhone.Build.0 = Debug|iPhone 138 | {C913A816-D238-4F48-BD74-419D82B07904}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator 139 | {C913A816-D238-4F48-BD74-419D82B07904}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator 140 | {C913A816-D238-4F48-BD74-419D82B07904}.Debug|x64.ActiveCfg = Debug|iPhone 141 | {C913A816-D238-4F48-BD74-419D82B07904}.Debug|x86.ActiveCfg = Debug|iPhone 142 | {C913A816-D238-4F48-BD74-419D82B07904}.Release|Any CPU.ActiveCfg = Release|iPhone 143 | {C913A816-D238-4F48-BD74-419D82B07904}.Release|ARM.ActiveCfg = Release|iPhone 144 | {C913A816-D238-4F48-BD74-419D82B07904}.Release|iPhone.ActiveCfg = Release|iPhone 145 | {C913A816-D238-4F48-BD74-419D82B07904}.Release|iPhone.Build.0 = Release|iPhone 146 | {C913A816-D238-4F48-BD74-419D82B07904}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator 147 | {C913A816-D238-4F48-BD74-419D82B07904}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator 148 | {C913A816-D238-4F48-BD74-419D82B07904}.Release|x64.ActiveCfg = Release|iPhone 149 | {C913A816-D238-4F48-BD74-419D82B07904}.Release|x86.ActiveCfg = Release|iPhone 150 | EndGlobalSection 151 | GlobalSection(SolutionProperties) = preSolution 152 | HideSolutionNode = FALSE 153 | EndGlobalSection 154 | GlobalSection(ExtensibilityGlobals) = postSolution 155 | SolutionGuid = {CBB6EB1B-EF3F-4853-8231-4C750BCBFFFB} 156 | EndGlobalSection 157 | EndGlobal 158 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.Android/Assets/AboutAssets.txt: -------------------------------------------------------------------------------- 1 | Any raw assets you want to be deployed with your application can be placed in 2 | this directory (and child directories) and given a Build Action of "AndroidAsset". 3 | 4 | These files will be deployed with you package and will be accessible using Android's 5 | AssetManager, like this: 6 | 7 | public class ReadAsset : Activity 8 | { 9 | protected override void OnCreate (Bundle bundle) 10 | { 11 | base.OnCreate (bundle); 12 | 13 | InputStream input = Assets.Open ("my_asset.txt"); 14 | } 15 | } 16 | 17 | Additionally, some Android functions will automatically load asset files: 18 | 19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); 20 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.Android/EasyChat.Android.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | 8.0.30703 8 | 2.0 9 | {C21B2B5B-7439-422C-AE88-D30630426933} 10 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 11 | Library 12 | Properties 13 | EasyChat.Droid 14 | EasyChat.Android 15 | 512 16 | true 17 | Resources\Resource.Designer.cs 18 | Off 19 | Properties\AndroidManifest.xml 20 | true 21 | v7.1 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | true 31 | full 32 | false 33 | bin\Debug\ 34 | DEBUG;TRACE 35 | prompt 36 | 4 37 | True 38 | None 39 | armeabi,armeabi-v7a,x86 40 | 41 | 42 | pdbonly 43 | true 44 | bin\Release\ 45 | TRACE 46 | prompt 47 | 4 48 | False 49 | SdkOnly 50 | 51 | 52 | 53 | ..\..\packages\Xamarin.Forms.2.4.0.282\lib\MonoAndroid10\FormsViewGroup.dll 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | ..\..\packages\Xamarin.Android.Support.Animated.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Animated.Vector.Drawable.dll 63 | 64 | 65 | ..\..\packages\Xamarin.Android.Support.Design.23.3.0\lib\MonoAndroid43\Xamarin.Android.Support.Design.dll 66 | 67 | 68 | ..\..\packages\Xamarin.Android.Support.v4.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll 69 | 70 | 71 | ..\..\packages\Xamarin.Android.Support.v7.AppCompat.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.AppCompat.dll 72 | 73 | 74 | ..\..\packages\Xamarin.Android.Support.v7.CardView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.CardView.dll 75 | 76 | 77 | ..\..\packages\Xamarin.Android.Support.v7.MediaRouter.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.MediaRouter.dll 78 | 79 | 80 | ..\..\packages\Xamarin.Android.Support.v7.RecyclerView.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.v7.RecyclerView.dll 81 | 82 | 83 | ..\..\packages\Xamarin.Android.Support.Vector.Drawable.23.3.0\lib\MonoAndroid403\Xamarin.Android.Support.Vector.Drawable.dll 84 | 85 | 86 | ..\..\packages\Xamarin.Forms.2.4.0.282\lib\MonoAndroid10\Xamarin.Forms.Core.dll 87 | 88 | 89 | ..\..\packages\Xamarin.Forms.2.4.0.282\lib\MonoAndroid10\Xamarin.Forms.Platform.dll 90 | 91 | 92 | ..\..\packages\Xamarin.Forms.2.4.0.282\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll 93 | 94 | 95 | ..\..\packages\Xamarin.Forms.2.4.0.282\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll 96 | 97 | 98 | ..\..\packages\Plugin.CurrentActivity.1.0.1\lib\MonoAndroid10\Plugin.CurrentActivity.dll 99 | 100 | 101 | ..\..\packages\Xam.Plugin.DeviceInfo.3.0.1\lib\MonoAndroid10\Plugin.DeviceInfo.Abstractions.dll 102 | 103 | 104 | ..\..\packages\Xam.Plugin.DeviceInfo.3.0.1\lib\MonoAndroid10\Plugin.DeviceInfo.dll 105 | 106 | 107 | 108 | 109 | 110 | ..\..\packages\Newtonsoft.Json.10.0.3\lib\netstandard1.3\Newtonsoft.Json.dll 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 141 | 142 | 143 | 144 | 145 | 146 | 147 | 154 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.Android/MainActivity.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Android.App; 4 | using Android.Content.PM; 5 | using Android.Runtime; 6 | using Android.Views; 7 | using Android.Widget; 8 | using Android.OS; 9 | 10 | namespace EasyChat.Droid 11 | { 12 | [Activity (Label = "EasyChat", Icon = "@drawable/icon", Theme="@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] 13 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity 14 | { 15 | protected override void OnCreate (Bundle bundle) 16 | { 17 | TabLayoutResource = Resource.Layout.Tabbar; 18 | ToolbarResource = Resource.Layout.Toolbar; 19 | 20 | base.OnCreate (bundle); 21 | 22 | global::Xamarin.Forms.Forms.Init (this, bundle); 23 | LoadApplication (new EasyChat.App ()); 24 | } 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.Android/MainApplication.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Android.App; 4 | using Android.OS; 5 | using Android.Runtime; 6 | using Plugin.CurrentActivity; 7 | 8 | namespace EasyChat.Droid 9 | { 10 | //You can specify additional application information in this attribute 11 | [Application] 12 | public class MainApplication : Application, Application.IActivityLifecycleCallbacks 13 | { 14 | public MainApplication(IntPtr handle, JniHandleOwnership transer) 15 | :base(handle, transer) 16 | { 17 | } 18 | 19 | public override void OnCreate() 20 | { 21 | base.OnCreate(); 22 | RegisterActivityLifecycleCallbacks(this); 23 | //A great place to initialize Xamarin.Insights and Dependency Services! 24 | } 25 | 26 | public override void OnTerminate() 27 | { 28 | base.OnTerminate(); 29 | UnregisterActivityLifecycleCallbacks(this); 30 | } 31 | 32 | public void OnActivityCreated(Activity activity, Bundle savedInstanceState) 33 | { 34 | CrossCurrentActivity.Current.Activity = activity; 35 | } 36 | 37 | public void OnActivityDestroyed(Activity activity) 38 | { 39 | } 40 | 41 | public void OnActivityPaused(Activity activity) 42 | { 43 | } 44 | 45 | public void OnActivityResumed(Activity activity) 46 | { 47 | CrossCurrentActivity.Current.Activity = activity; 48 | } 49 | 50 | public void OnActivitySaveInstanceState(Activity activity, Bundle outState) 51 | { 52 | } 53 | 54 | public void OnActivityStarted(Activity activity) 55 | { 56 | CrossCurrentActivity.Current.Activity = activity; 57 | } 58 | 59 | public void OnActivityStopped(Activity activity) 60 | { 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.Android/Properties/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.Android/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using Android.App; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("EasyChat.Android")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("EasyChat.Android")] 14 | [assembly: AssemblyCopyright("Copyright © 2014")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | [assembly: ComVisible(false)] 18 | 19 | // Version information for an assembly consists of the following four values: 20 | // 21 | // Major Version 22 | // Minor Version 23 | // Build Number 24 | // Revision 25 | // 26 | // You can specify all the values or you can default the Build and Revision Numbers 27 | // by using the '*' as shown below: 28 | // [assembly: AssemblyVersion("1.0.*")] 29 | [assembly: AssemblyVersion("1.0.0.0")] 30 | [assembly: AssemblyFileVersion("1.0.0.0")] 31 | 32 | // Add some common permissions, these can be removed if not needed 33 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)] 34 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)] 35 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.Android/Resources/AboutResources.txt: -------------------------------------------------------------------------------- 1 | Images, layout descriptions, binary blobs and string dictionaries can be included 2 | in your application as resource files. Various Android APIs are designed to 3 | operate on the resource IDs instead of dealing with images, strings or binary blobs 4 | directly. 5 | 6 | For example, a sample Android app that contains a user interface layout (main.xml), 7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png) 8 | would keep its resources in the "Resources" directory of the application: 9 | 10 | Resources/ 11 | drawable-hdpi/ 12 | icon.png 13 | 14 | drawable-ldpi/ 15 | icon.png 16 | 17 | drawable-mdpi/ 18 | icon.png 19 | 20 | layout/ 21 | main.xml 22 | 23 | values/ 24 | strings.xml 25 | 26 | In order to get the build system to recognize Android resources, set the build action to 27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but 28 | instead operate on resource IDs. When you compile an Android application that uses resources, 29 | the build system will package the resources for distribution and generate a class called 30 | "Resource" that contains the tokens for each one of the resources included. For example, 31 | for the above Resources layout, this is what the Resource class would expose: 32 | 33 | public class Resource { 34 | public class drawable { 35 | public const int icon = 0x123; 36 | } 37 | 38 | public class layout { 39 | public const int main = 0x456; 40 | } 41 | 42 | public class strings { 43 | public const int first_string = 0xabc; 44 | public const int second_string = 0xbcd; 45 | } 46 | } 47 | 48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main 49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first 50 | string in the dictionary file values/strings.xml. 51 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.Android/Resources/drawable-hdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.Android/Resources/drawable-hdpi/icon.png -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.Android/Resources/drawable-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.Android/Resources/drawable-xhdpi/icon.png -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.Android/Resources/drawable-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.Android/Resources/drawable-xxhdpi/icon.png -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.Android/Resources/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.Android/Resources/drawable/icon.png -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.Android/Resources/layout/Tabbar.axml: -------------------------------------------------------------------------------- 1 | 2 | 12 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.Android/Resources/layout/Toolbar.axml: -------------------------------------------------------------------------------- 1 | 9 | 10 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.Android/Resources/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 26 | 27 | 30 | 31 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.Android/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/AppDelegate.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace EasyChat.iOS 9 | { 10 | // The UIApplicationDelegate for the application. This class is responsible for launching the 11 | // User Interface of the application, as well as listening (and optionally responding) to 12 | // application events from iOS. 13 | [Register("AppDelegate")] 14 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate 15 | { 16 | // 17 | // This method is invoked when the application has loaded and is ready to run. In this 18 | // method you should instantiate the window, load the UI into it and then make the window 19 | // visible. 20 | // 21 | // You have 17 seconds to return from this method, or iOS will terminate your application. 22 | // 23 | public override bool FinishedLaunching(UIApplication app, NSDictionary options) 24 | { 25 | global::Xamarin.Forms.Forms.Init (); 26 | LoadApplication (new EasyChat.App ()); 27 | 28 | return base.FinishedLaunching (app, options); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/EasyChat.iOS.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | iPhoneSimulator 7 | 8.0.30703 8 | 2.0 9 | {C913A816-D238-4F48-BD74-419D82B07904} 10 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 11 | Exe 12 | EasyChat.iOS 13 | Resources 14 | EasyChat.iOS 15 | 16 | 17 | 18 | 19 | true 20 | full 21 | false 22 | bin\iPhoneSimulator\Debug 23 | DEBUG 24 | prompt 25 | 4 26 | false 27 | i386, x86_64 28 | None 29 | true 30 | 31 | 32 | none 33 | true 34 | bin\iPhoneSimulator\Release 35 | prompt 36 | 4 37 | None 38 | i386, x86_64 39 | false 40 | 41 | 42 | true 43 | full 44 | false 45 | bin\iPhone\Debug 46 | DEBUG 47 | prompt 48 | 4 49 | false 50 | ARMv7, ARM64 51 | iPhone Developer 52 | true 53 | Entitlements.plist 54 | 55 | 56 | none 57 | true 58 | bin\iPhone\Release 59 | prompt 60 | 4 61 | ARMv7, ARM64 62 | false 63 | iPhone Developer 64 | Entitlements.plist 65 | 66 | 67 | none 68 | True 69 | bin\iPhone\Ad-Hoc 70 | prompt 71 | 4 72 | False 73 | ARMv7, ARM64 74 | True 75 | Automatic:AdHoc 76 | iPhone Distribution 77 | Entitlements.plist 78 | 79 | 80 | none 81 | True 82 | bin\iPhone\AppStore 83 | prompt 84 | 4 85 | False 86 | ARMv7, ARM64 87 | Automatic:AppStore 88 | iPhone Distribution 89 | Entitlements.plist 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | ..\..\packages\Xamarin.Forms.2.4.0.282\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll 126 | 127 | 128 | ..\..\packages\Xamarin.Forms.2.4.0.282\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll 129 | 130 | 131 | ..\..\packages\Xamarin.Forms.2.4.0.282\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll 132 | 133 | 134 | ..\..\packages\Xamarin.Forms.2.4.0.282\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll 135 | 136 | 137 | ..\..\packages\Xam.Plugin.DeviceInfo.3.0.1\lib\Xamarin.iOS10\Plugin.DeviceInfo.Abstractions.dll 138 | 139 | 140 | ..\..\packages\Xam.Plugin.DeviceInfo.3.0.1\lib\Xamarin.iOS10\Plugin.DeviceInfo.dll 141 | 142 | 143 | 144 | 145 | 146 | ..\..\packages\Newtonsoft.Json.10.0.3\lib\netstandard1.3\Newtonsoft.Json.dll 147 | 148 | 149 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Entitlements.plist: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Info.plist: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | UIDeviceFamily 6 | 7 | 1 8 | 2 9 | 10 | UISupportedInterfaceOrientations 11 | 12 | UIInterfaceOrientationPortrait 13 | UIInterfaceOrientationLandscapeLeft 14 | UIInterfaceOrientationLandscapeRight 15 | 16 | UISupportedInterfaceOrientations~ipad 17 | 18 | UIInterfaceOrientationPortrait 19 | UIInterfaceOrientationPortraitUpsideDown 20 | UIInterfaceOrientationLandscapeLeft 21 | UIInterfaceOrientationLandscapeRight 22 | 23 | MinimumOSVersion 24 | 8.0 25 | CFBundleDisplayName 26 | EasyChat 27 | CFBundleIdentifier 28 | com.yourcompany.EasyChat 29 | CFBundleVersion 30 | 1.0 31 | CFBundleIconFiles 32 | 33 | Icon-60@2x.png 34 | Icon-60@3x.png 35 | Icon-76.png 36 | Icon-76@2x.png 37 | Default.png 38 | Default@2x.png 39 | Default-568h@2x.png 40 | Default-Portrait.png 41 | Default-Portrait@2x.png 42 | Icon-Small-40.png 43 | Icon-Small-40@2x.png 44 | Icon-Small-40@3x.png 45 | Icon-Small.png 46 | Icon-Small@2x.png 47 | Icon-Small@3x.png 48 | 49 | UILaunchStoryboardName 50 | LaunchScreen.storyboard 51 | 52 | 53 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Main.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | using Foundation; 6 | using UIKit; 7 | 8 | namespace EasyChat.iOS 9 | { 10 | public class Application 11 | { 12 | // This is the main entry point of the application. 13 | static void Main(string[] args) 14 | { 15 | // if you want to use a different Application Delegate class from "AppDelegate" 16 | // you can specify it here. 17 | UIApplication.Main(args, null, "AppDelegate"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("EasyChat.iOS")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("EasyChat.iOS")] 13 | [assembly: AssemblyCopyright("Copyright © 2014")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Resources/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.iOS/Resources/Default-568h@2x.png -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Resources/Default-Portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.iOS/Resources/Default-Portrait.png -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Resources/Default-Portrait@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.iOS/Resources/Default-Portrait@2x.png -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Resources/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.iOS/Resources/Default.png -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Resources/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.iOS/Resources/Default@2x.png -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-60@2x.png -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-60@3x.png -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-76.png -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-76@2x.png -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-Small-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-Small-40.png -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-Small-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-Small-40@2x.png -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-Small-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-Small-40@3x.png -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-Small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-Small.png -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-Small@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-Small@2x.png -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-Small@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.iOS/Resources/Icon-Small@3x.png -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/Resources/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/iTunesArtwork: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.iOS/iTunesArtwork -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/iTunesArtwork@2x: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/prashantvc/easychat-service/231bb4df4415b6cf54382a32923dfb705f801f8e/EasyChat/EasyChat/EasyChat.iOS/iTunesArtwork@2x -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat.iOS/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat/App.xaml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Net.WebSockets; 6 | 7 | using Xamarin.Forms; 8 | 9 | namespace EasyChat 10 | { 11 | public partial class App : Application 12 | { 13 | public App() 14 | { 15 | InitializeComponent(); 16 | 17 | MainPage = new NavigationPage(new MainPage()); 18 | } 19 | 20 | protected override void OnStart() 21 | { 22 | // Handle when your app starts 23 | } 24 | 25 | protected override void OnSleep() 26 | { 27 | // Handle when your app sleeps 28 | } 29 | 30 | protected override void OnResume() 31 | { 32 | // Handle when your app resumes 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat/ChatDataTemplateSelector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | using Xamarin.Forms; 4 | 5 | namespace EasyChat 6 | { 7 | class MyDataTemplateSelector : Xamarin.Forms.DataTemplateSelector 8 | { 9 | public MyDataTemplateSelector() 10 | { 11 | // Retain instances! 12 | this.incomingDataTemplate = new DataTemplate(typeof(IncomingViewCell)); 13 | this.outgoingDataTemplate = new DataTemplate(typeof(OutgoingViewCell)); 14 | } 15 | 16 | protected override DataTemplate OnSelectTemplate(object item, BindableObject container) 17 | { 18 | var messageVm = item as Message; 19 | if (messageVm == null) 20 | return null; 21 | return messageVm.IsIncoming ? this.incomingDataTemplate : this.outgoingDataTemplate; 22 | } 23 | 24 | private readonly DataTemplate incomingDataTemplate; 25 | private readonly DataTemplate outgoingDataTemplate; 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat/ChatPage.xaml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 11 | 12 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat/MainPage.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net.WebSockets; 3 | using System.Threading; 4 | using Xamarin.Forms; 5 | 6 | namespace EasyChat 7 | { 8 | public partial class MainPage : ContentPage 9 | { 10 | public MainPage() 11 | { 12 | InitializeComponent(); 13 | } 14 | 15 | async void Button_OnClicked(object sender, EventArgs e) 16 | { 17 | if (string.IsNullOrEmpty(UserName.Text)) 18 | { 19 | await DisplayAlert("Easy Chat", "Please enter username", "OK"); 20 | return; 21 | } 22 | 23 | await Navigation.PushAsync(new ChatPage(UserName.Text)); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /EasyChat/EasyChat/EasyChat/Message.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.ComponentModel; 3 | using System.Runtime.CompilerServices; 4 | using Xamarin.Forms; 5 | using Plugin.DeviceInfo; 6 | 7 | namespace EasyChat 8 | { 9 | public class Message 10 | { 11 | public string Text { get; set; } 12 | public DateTime MessagDateTime { get; set; } 13 | 14 | public bool IsIncoming => UserId != CrossDeviceInfo.Current.Id; 15 | 16 | public string Name { get; set; } 17 | public string UserId { get; set; } 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## easychat-service 2 | 3 | Xamarin.Forms sample app to communicate with WebSocket server 4 | 5 | ### Projects 6 | 7 | #### EasyChat 8 | Xamarin.Forms client application, open in Visual Studio on Mac or Windows 9 | 10 | #### service 11 | 12 | WebSock server running on dotnet core 2.0 13 | 14 | **Set up instructions** 15 | 1. Install dotnet core 2.0, you can find the instructions at https://www.microsoft.com/net/download/core 16 | 2. Execute dotnet run command 17 | 3. Visit http://localhost:5000, make sure you see Easy chat service message on the webpage -------------------------------------------------------------------------------- /service/EasyChatService.cs: -------------------------------------------------------------------------------- 1 | 2 | using System; 3 | using System.Linq; 4 | using System.Collections.Concurrent; 5 | using System.IO; 6 | using System.Net.WebSockets; 7 | using System.Text; 8 | using System.Threading; 9 | using System.Threading.Tasks; 10 | using Microsoft.AspNetCore.Http; 11 | 12 | namespace easychat 13 | { 14 | public class EasyChatService 15 | { 16 | public EasyChatService(RequestDelegate requestDelegate) 17 | { 18 | this.requestDelegate = requestDelegate; 19 | } 20 | 21 | public async Task Invoke(HttpContext context) 22 | { 23 | if (!context.WebSockets.IsWebSocketRequest) 24 | { 25 | await requestDelegate.Invoke(context); 26 | return; 27 | } 28 | 29 | var token = context.RequestAborted; 30 | var socket = await context.WebSockets.AcceptWebSocketAsync(); 31 | 32 | var guid = Guid.NewGuid().ToString(); 33 | sockets.TryAdd(guid, socket); 34 | 35 | while (true) 36 | { 37 | if (token.IsCancellationRequested) 38 | break; 39 | 40 | var message = await GetMessageAsync(socket, token); 41 | System.Console.WriteLine($"Received message - {message} at {DateTime.Now}"); 42 | 43 | if (string.IsNullOrEmpty(message)) 44 | { 45 | if (socket.State != WebSocketState.Open) 46 | break; 47 | 48 | continue; 49 | } 50 | 51 | foreach (var s in sockets.Where(p => p.Value.State == WebSocketState.Open)) 52 | await SendMessageAsync(s.Value, message, token); 53 | } 54 | 55 | sockets.TryRemove(guid, out WebSocket redundantSocket); 56 | 57 | await socket.CloseAsync(WebSocketCloseStatus.NormalClosure, "Session ended", token); 58 | socket.Dispose(); 59 | } 60 | 61 | async Task GetMessageAsync(WebSocket socket, CancellationToken token) 62 | { 63 | WebSocketReceiveResult result; 64 | var message = new ArraySegment(new byte[4096]); 65 | string receivedMessage = string.Empty; 66 | 67 | do 68 | { 69 | token.ThrowIfCancellationRequested(); 70 | 71 | result = await socket.ReceiveAsync(message, token); 72 | var messageBytes = message.Skip(message.Offset).Take(result.Count).ToArray(); 73 | receivedMessage = Encoding.UTF8.GetString(messageBytes); 74 | 75 | } while (!result.EndOfMessage); 76 | 77 | if (result.MessageType != WebSocketMessageType.Text) 78 | return null; 79 | 80 | return receivedMessage; 81 | } 82 | 83 | Task SendMessageAsync(WebSocket socket, string message, CancellationToken token) 84 | { 85 | var byteMessage = Encoding.UTF8.GetBytes(message); 86 | var segmnet = new ArraySegment(byteMessage); 87 | 88 | return socket.SendAsync(segmnet, WebSocketMessageType.Text, true, token); 89 | } 90 | 91 | readonly RequestDelegate requestDelegate; 92 | ConcurrentDictionary sockets = new ConcurrentDictionary(); 93 | } 94 | } -------------------------------------------------------------------------------- /service/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace easychat 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | BuildWebHost(args).Run(); 18 | } 19 | 20 | public static IWebHost BuildWebHost(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup() 23 | .UseUrls("http://*:5000") 24 | .Build(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /service/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:5000/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "easychat": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:5000/" 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /service/Readme.md: -------------------------------------------------------------------------------- 1 | # Easy Chat Service 2 | 3 | ### Set up instructions 4 | 1. Install dotnet core 2.0, you can find the instructions at https://www.microsoft.com/net/download/core 5 | 2. Execute `dotnet run` command 6 | 3. Visit _http://localhost:5000_, make sure you see _Easy chat service_ message on the webpage -------------------------------------------------------------------------------- /service/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.AspNetCore.Http; 8 | using Microsoft.Extensions.DependencyInjection; 9 | 10 | namespace easychat 11 | { 12 | public class Startup 13 | { 14 | // This method gets called by the runtime. Use this method to add services to the container. 15 | // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 16 | public void ConfigureServices(IServiceCollection services) 17 | { 18 | } 19 | 20 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 21 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 22 | { 23 | app.UseWebSockets(); 24 | app.UseMiddleware(); 25 | app.Run(async (context) => 26 | { 27 | await context.Response.WriteAsync("Easy chat service"); 28 | }); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /service/easychat.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | --------------------------------------------------------------------------------