├── .gitattributes
├── .github
└── workflows
│ ├── pr.yml
│ └── release.yml
├── .gitignore
├── LICENSE
├── README.md
├── ShortcutBadger.sln
├── example
└── ExampleShortcutBadgerApp
│ ├── Assets
│ └── AboutAssets.txt
│ ├── ExampleShortcutBadgerApp.csproj
│ ├── MainActivity.cs
│ ├── Properties
│ └── AndroidManifest.xml
│ └── Resources
│ ├── AboutResources.txt
│ ├── drawable
│ └── Icon.png
│ ├── layout
│ └── Main.axml
│ └── values
│ └── Strings.xml
├── global.json
├── logo
├── horizontalversion.png
├── icon.png
└── logo.png
└── src
└── XamarinShortcutBadger
├── Additions
└── AboutAdditions.txt
├── Jars
├── AboutJars.txt
├── README.md
├── ShortcutBadger-1.1.22-javadoc.jar
├── ShortcutBadger-1.1.22-sources.jar
├── ShortcutBadger-1.1.22.aar
└── ShortcutBadger-1.1.22.pom
├── Transforms
├── EnumFields.xml
├── EnumMethods.xml
└── Metadata.xml
└── XamarinShortcutBadger.csproj
/.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 |
--------------------------------------------------------------------------------
/.github/workflows/pr.yml:
--------------------------------------------------------------------------------
1 | name: Build Solution
2 |
3 | on:
4 | push:
5 | pull_request:
6 | branches: [ main ]
7 | paths-ignore:
8 | - 'README.md'
9 |
10 | jobs:
11 | build:
12 | name: Build
13 | runs-on: macOS-latest
14 |
15 | steps:
16 | - uses: actions/checkout@v4
17 |
18 | - name: Setup .NET
19 | uses: actions/setup-dotnet@v4
20 | with:
21 | global-json-file: global.json
22 |
23 | - name: Install .NET Workloads
24 | run: dotnet workload install android
25 |
26 | - name: Install NuGet dependencies
27 | run: dotnet restore
28 |
29 | - name: Build
30 | run: dotnet build --configuration Debug --no-restore --verbosity detailed
31 |
32 | # - name: Test
33 | # run: dotnet test --no-restore --verbosity normal
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release NuGet
2 |
3 | on:
4 | workflow_dispatch:
5 |
6 | jobs:
7 | build:
8 | name: Build
9 | runs-on: macOS-latest
10 |
11 | steps:
12 | - uses: actions/checkout@v4
13 |
14 | - name: Setup .NET
15 | uses: actions/setup-dotnet@v4
16 | with:
17 | global-json-file: global.json
18 |
19 | - name: Install .NET Workloads
20 | run: dotnet workload install android
21 |
22 | - name: Install NuGet dependencies
23 | run: dotnet restore
24 |
25 | - name: Pack
26 | run: dotnet pack --configuration Release --no-restore --output . --verbosity detailed
27 |
28 | - name: Upload artifact
29 | uses: actions/upload-artifact@v3
30 | with:
31 | name: build-artifact
32 | path: Xamarin.ShortcutBadger.*.nupkg
33 |
34 | publish-nuget:
35 | name: Publish to NuGet.org
36 | needs: build
37 | runs-on: ubuntu-latest
38 |
39 | steps:
40 | - name: Download artifact
41 | uses: actions/download-artifact@v3
42 | with:
43 | name: build-artifact
44 |
45 | - name: Publish
46 | run: dotnet nuget push "*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json
47 |
48 | # - name: Create Release
49 | # run:
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | # Created by https://www.gitignore.io/api/macos,windows,visualstudio,xamarinstudio
3 |
4 | ### macOS ###
5 | *.DS_Store
6 | .AppleDouble
7 | .LSOverride
8 |
9 | # Icon must end with two \r
10 | Icon
11 |
12 | # Thumbnails
13 | ._*
14 |
15 | # Files that might appear in the root of a volume
16 | .DocumentRevisions-V100
17 | .fseventsd
18 | .Spotlight-V100
19 | .TemporaryItems
20 | .Trashes
21 | .VolumeIcon.icns
22 | .com.apple.timemachine.donotpresent
23 |
24 | # Directories potentially created on remote AFP share
25 | .AppleDB
26 | .AppleDesktop
27 | Network Trash Folder
28 | Temporary Items
29 | .apdisk
30 |
31 | ### Windows ###
32 | # Windows thumbnail cache files
33 | Thumbs.db
34 | ehthumbs.db
35 | ehthumbs_vista.db
36 |
37 | # Folder config file
38 | Desktop.ini
39 |
40 | # Recycle Bin used on file shares
41 | $RECYCLE.BIN/
42 |
43 | # Windows Installer files
44 | *.cab
45 | *.msi
46 | *.msm
47 | *.msp
48 |
49 | # Windows shortcuts
50 | *.lnk
51 |
52 | ### XamarinStudio ###
53 | bin/
54 | obj/
55 | *.userprefs
56 | .packages
57 |
58 | ### VisualStudio ###
59 | ## Ignore Visual Studio temporary files, build results, and
60 | ## files generated by popular Visual Studio add-ons.
61 | ##
62 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
63 |
64 | # User-specific files
65 | *.suo
66 | *.user
67 | *.userosscache
68 | *.sln.docstates
69 |
70 | # User-specific files (MonoDevelop/Xamarin Studio)
71 |
72 | # Build results
73 | [Dd]ebug/
74 | [Dd]ebugPublic/
75 | [Rr]elease/
76 | [Rr]eleases/
77 | x64/
78 | x86/
79 | bld/
80 | [Bb]in/
81 | [Oo]bj/
82 | [Ll]og/
83 |
84 | # Visual Studio 2015 cache/options directory
85 | .vs/
86 | # Uncomment if you have tasks that create the project's static files in wwwroot
87 | #wwwroot/
88 |
89 | # MSTest test Results
90 | [Tt]est[Rr]esult*/
91 | [Bb]uild[Ll]og.*
92 |
93 | # NUNIT
94 | *.VisualState.xml
95 | TestResult.xml
96 |
97 | # Build Results of an ATL Project
98 | [Dd]ebugPS/
99 | [Rr]eleasePS/
100 | dlldata.c
101 |
102 | # .NET Core
103 | project.lock.json
104 | project.fragment.lock.json
105 | artifacts/
106 | **/Properties/launchSettings.json
107 |
108 | *_i.c
109 | *_p.c
110 | *_i.h
111 | *.ilk
112 | *.meta
113 | *.obj
114 | *.pch
115 | *.pdb
116 | *.pgc
117 | *.pgd
118 | *.rsp
119 | *.sbr
120 | *.tlb
121 | *.tli
122 | *.tlh
123 | *.tmp
124 | *.tmp_proj
125 | *.log
126 | *.vspscc
127 | *.vssscc
128 | .builds
129 | *.pidb
130 | *.svclog
131 | *.scc
132 |
133 | # Chutzpah Test files
134 | _Chutzpah*
135 |
136 | # Visual C++ cache files
137 | ipch/
138 | *.aps
139 | *.ncb
140 | *.opendb
141 | *.opensdf
142 | *.sdf
143 | *.cachefile
144 | *.VC.db
145 | *.VC.VC.opendb
146 |
147 | # Visual Studio profiler
148 | *.psess
149 | *.vsp
150 | *.vspx
151 | *.sap
152 |
153 | # TFS 2012 Local Workspace
154 | $tf/
155 |
156 | # Guidance Automation Toolkit
157 | *.gpState
158 |
159 | # ReSharper is a .NET coding add-in
160 | _ReSharper*/
161 | *.[Rr]e[Ss]harper
162 | *.DotSettings.user
163 |
164 | # JustCode is a .NET coding add-in
165 | .JustCode
166 |
167 | # TeamCity is a build add-in
168 | _TeamCity*
169 |
170 | # DotCover is a Code Coverage Tool
171 | *.dotCover
172 |
173 | # Visual Studio code coverage results
174 | *.coverage
175 | *.coveragexml
176 |
177 | # NCrunch
178 | _NCrunch_*
179 | .*crunch*.local.xml
180 | nCrunchTemp_*
181 |
182 | # MightyMoose
183 | *.mm.*
184 | AutoTest.Net/
185 |
186 | # Web workbench (sass)
187 | .sass-cache/
188 |
189 | # Installshield output folder
190 | [Ee]xpress/
191 |
192 | # DocProject is a documentation generator add-in
193 | DocProject/buildhelp/
194 | DocProject/Help/*.HxT
195 | DocProject/Help/*.HxC
196 | DocProject/Help/*.hhc
197 | DocProject/Help/*.hhk
198 | DocProject/Help/*.hhp
199 | DocProject/Help/Html2
200 | DocProject/Help/html
201 |
202 | # Click-Once directory
203 | publish/
204 |
205 | # Publish Web Output
206 | *.[Pp]ublish.xml
207 | *.azurePubxml
208 | # TODO: Uncomment the next line to ignore your web deploy settings.
209 | # By default, sensitive information, such as encrypted password
210 | # should be stored in the .pubxml.user file.
211 | #*.pubxml
212 | *.pubxml.user
213 | *.publishproj
214 |
215 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
216 | # checkin your Azure Web App publish settings, but sensitive information contained
217 | # in these scripts will be unencrypted
218 | PublishScripts/
219 |
220 | # NuGet Packages
221 | *.nupkg
222 | # The packages folder can be ignored because of Package Restore
223 | **/packages/*
224 | # except build/, which is used as an MSBuild target.
225 | !**/packages/build/
226 | # Uncomment if necessary however generally it will be regenerated when needed
227 | #!**/packages/repositories.config
228 | # NuGet v3's project.json files produces more ignorable files
229 | *.nuget.props
230 | *.nuget.targets
231 |
232 | # Microsoft Azure Build Output
233 | csx/
234 | *.build.csdef
235 |
236 | # Microsoft Azure Emulator
237 | ecf/
238 | rcf/
239 |
240 | # Windows Store app package directories and files
241 | AppPackages/
242 | BundleArtifacts/
243 | Package.StoreAssociation.xml
244 | _pkginfo.txt
245 |
246 | # Visual Studio cache files
247 | # files ending in .cache can be ignored
248 | *.[Cc]ache
249 | # but keep track of directories ending in .cache
250 | !*.[Cc]ache/
251 |
252 | # Others
253 | ClientBin/
254 | ~$*
255 | *~
256 | *.dbmdl
257 | *.dbproj.schemaview
258 | *.jfm
259 | *.pfx
260 | *.publishsettings
261 | orleans.codegen.cs
262 |
263 | # Since there are multiple workflows, uncomment next line to ignore bower_components
264 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
265 | #bower_components/
266 |
267 | # RIA/Silverlight projects
268 | Generated_Code/
269 |
270 | # Backup & report files from converting an old project file
271 | # to a newer Visual Studio version. Backup files are not needed,
272 | # because we have git ;-)
273 | _UpgradeReport_Files/
274 | Backup*/
275 | UpgradeLog*.XML
276 | UpgradeLog*.htm
277 |
278 | # SQL Server files
279 | *.mdf
280 | *.ldf
281 | *.ndf
282 |
283 | # Business Intelligence projects
284 | *.rdl.data
285 | *.bim.layout
286 | *.bim_*.settings
287 |
288 | # Microsoft Fakes
289 | FakesAssemblies/
290 |
291 | # GhostDoc plugin setting file
292 | *.GhostDoc.xml
293 |
294 | # Node.js Tools for Visual Studio
295 | .ntvs_analysis.dat
296 | node_modules/
297 |
298 | # Typescript v1 declaration files
299 | typings/
300 |
301 | # Visual Studio 6 build log
302 | *.plg
303 |
304 | # Visual Studio 6 workspace options file
305 | *.opt
306 |
307 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
308 | *.vbw
309 |
310 | # Visual Studio LightSwitch build output
311 | **/*.HTMLClient/GeneratedArtifacts
312 | **/*.DesktopClient/GeneratedArtifacts
313 | **/*.DesktopClient/ModelManifest.xml
314 | **/*.Server/GeneratedArtifacts
315 | **/*.Server/ModelManifest.xml
316 | _Pvt_Extensions
317 |
318 | # Paket dependency manager
319 | .paket/paket.exe
320 | paket-files/
321 |
322 | # FAKE - F# Make
323 | .fake/
324 |
325 | # JetBrains Rider
326 | .idea/
327 | *.sln.iml
328 |
329 | # CodeRush
330 | .cr/
331 |
332 | # Python Tools for Visual Studio (PTVS)
333 | __pycache__/
334 | *.pyc
335 |
336 | # Cake - Uncomment if you are using it
337 | # tools/**
338 | # !tools/packages.config
339 |
340 | # Telerik's JustMock configuration file
341 | *.jmconfig
342 |
343 | # BizTalk build output
344 | *.btp.cs
345 | *.btm.cs
346 | *.odx.cs
347 | *.xsd.cs
348 |
349 | ### VisualStudio Patch ###
350 | # By default, sensitive information, such as encrypted password
351 | # should be stored in the .pubxml.user file.
352 |
353 |
354 | # End of https://www.gitignore.io/api/macos,windows,visualstudio,xamarinstudio
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2014-2024 Leo Lin, Yauheni Pakala
2 |
3 | Licensed under the Apache License, Version 2.0 (the "License");
4 | you may not use this file except in compliance with the License.
5 | You may obtain a copy of the License at
6 |
7 | http://www.apache.org/licenses/LICENSE-2.0
8 |
9 | Unless required by applicable law or agreed to in writing, software
10 | distributed under the License is distributed on an "AS IS" BASIS,
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | See the License for the specific language governing permissions and
13 | limitations under the License.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | # ShortcutBadger
4 |
5 |  [](https://www.nuget.org/packages/Xamarin.ShortcutBadger/) [](https://github.com/wcoder/ShortcutBadger/actions/workflows/pr.yml)
6 |
7 | Port of [ShortcutBadger](https://github.com/leolin310148/ShortcutBadger) for Xamarin.Android
8 |
9 | ---
10 |
11 | The ShortcutBadger makes your Android App show the count of unread messages as a badge on your App shortcut!
12 |
13 | ## Usage
14 |
15 | NuGet
16 |
17 | ```sh
18 | Install-Package Xamarin.ShortcutBadger
19 | ```
20 |
21 | Add the codes below:
22 |
23 | ```cs
24 | int badgeCount = 1;
25 | ShortcutBadger.ApplyCount(context, badgeCount);
26 | ```
27 |
28 | If you want to remove the badge:
29 |
30 | ```cs
31 | ShortcutBadger.RemoveCount(context);
32 | ```
33 |
34 | or
35 |
36 | ```cs
37 | ShortcutBadger.ApplyCount(context, 0);
38 | ```
39 |
40 | ## Supported launchers:
41 |
42 |
43 |
44 |
45 | Sony
46 |
47 |
48 | |
49 |
50 | Samsung
51 |
52 |
53 | |
54 |
55 | LG
56 |
57 |
58 | |
59 |
60 | HTC
61 |
62 |
63 | |
64 |
65 |
66 |
67 | Xiaomi
68 |
69 |
70 |
71 | |
72 |
73 | ASUS
74 |
75 |
76 | |
77 |
78 | ADW
79 |
80 |
81 | |
82 |
83 | APEX
84 |
85 |
86 | |
87 |
88 |
89 | NOVA
90 |
91 |
92 | |
93 |
94 | Huawei
95 |
96 | (Not Fully Support)
97 |
98 |
99 |
100 | (1.1.7+)
101 | |
102 |
103 | ZUK
104 |
105 |
106 |
107 | (1.1.10+)
108 | |
109 |
110 | OPPO
111 |
112 | (Not Fully Support)
113 |
114 |
115 |
116 | (1.1.10+)
117 | |
118 |
119 |
120 |
121 | EverythingMe
122 |
123 |
124 | |
125 |
126 | ZTE
127 |
128 |
129 |
130 | (1.1.17+)
131 | |
132 |
133 | KISS
134 |
135 |
136 |
137 | (1.1.18+)
138 | |
139 |
140 |
141 |
142 | LaunchTime
143 |
144 |
145 | |
146 |
147 | Yandex Launcher
148 |
149 |
150 |
151 | (1.1.23+)
152 | |
153 |
154 |
155 |
156 | * Nova launcher with TeslaUnread, Apex launcher, ADW Launcher provided by [notz](https://github.com/notz)
157 | * Solid launcher provided by [MajeurAndroid](https://github.com/MajeurAndroid)
158 | * KISS Launcher provided by [alexander255](https://github.com/alexander255)
159 |
160 | ## About Xiaomi devices
161 |
162 | Xiaomi devices require extra setup with notifications, please read [wiki](https://github.com/leolin310148/ShortcutBadger/wiki/Xiaomi-Device-Support).
163 |
164 | ## IsBadgeWorking?
165 |
166 | A tool for displaying your device, launcher & android version and testing whether ShortcutBadger works or not may be downloaded from
167 |
168 | * Google Play [https://play.google.com/store/apps/details?id=me.leolin.isbadgeworking](https://play.google.com/store/apps/details?id=me.leolin.isbadgeworking)
169 | * The GitHub repository [https://github.com/leolin310148/IsBadgeWorking.Android/releases](https://github.com/leolin310148/IsBadgeWorking.Android/releases)
170 |
171 | ## DEVELOP BY
172 |
173 | [Leo Lin](https://github.com/leolin310148) - leolin310148@gmail.com
174 |
175 | ## ABOUT Google Play Developer Term Violations
176 |
177 | If you receive a message from Google containing something like this:
178 |
179 | > REASON FOR WARNING: Violation of section 4.4 of the Developer Distribution Agreement.
180 |
181 | please use version 1.1.0+!
182 |
183 | ## CHANGE LOG
184 |
185 | 1.1.22:
186 |
187 | * Improve Oreo support (Thanks to [AlexStarc](https://github.com/AlexStarc))
188 |
189 | 1.1.21:
190 |
191 | * Using binding of native library
192 | * Change namespace from `Xamarin.ShortcutBadger` to `XamarinShortcutBadger`
193 |
194 | 1.1.19:
195 |
196 | * Fix multiple home package resolve issue.
197 |
198 | 1.1.18:
199 |
200 | * Add Kill Launcher Support
201 |
202 | 1.1.17:
203 |
204 | * Add ZTE Support
205 |
206 | 1.1.16:
207 |
208 | * Improve Sony Launcher support.
209 |
210 | LICENSE
211 | ===================================
212 |
213 | Copyright 2014-2024 Leo Lin, Yauheni Pakala
214 |
215 | Licensed under the Apache License, Version 2.0 (the "License");
216 | you may not use this file except in compliance with the License.
217 | You may obtain a copy of the License at
218 |
219 | http://www.apache.org/licenses/LICENSE-2.0
220 |
221 | Unless required by applicable law or agreed to in writing, software
222 | distributed under the License is distributed on an "AS IS" BASIS,
223 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
224 | See the License for the specific language governing permissions and
225 | limitations under the License.
226 |
--------------------------------------------------------------------------------
/ShortcutBadger.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamarinShortcutBadger", "src\XamarinShortcutBadger\XamarinShortcutBadger.csproj", "{A3D001F3-A38F-4EE1-B084-2E20C5581DF7}"
4 | EndProject
5 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleShortcutBadgerApp", "example\ExampleShortcutBadgerApp\ExampleShortcutBadgerApp.csproj", "{29FE9562-AC3F-41CD-9B5B-8E75A407FC10}"
6 | EndProject
7 | Global
8 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
9 | Debug|Any CPU = Debug|Any CPU
10 | Release|Any CPU = Release|Any CPU
11 | EndGlobalSection
12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
13 | {A3D001F3-A38F-4EE1-B084-2E20C5581DF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
14 | {A3D001F3-A38F-4EE1-B084-2E20C5581DF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
15 | {A3D001F3-A38F-4EE1-B084-2E20C5581DF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
16 | {A3D001F3-A38F-4EE1-B084-2E20C5581DF7}.Release|Any CPU.Build.0 = Release|Any CPU
17 | {29FE9562-AC3F-41CD-9B5B-8E75A407FC10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
18 | {29FE9562-AC3F-41CD-9B5B-8E75A407FC10}.Debug|Any CPU.Build.0 = Debug|Any CPU
19 | {29FE9562-AC3F-41CD-9B5B-8E75A407FC10}.Release|Any CPU.ActiveCfg = Release|Any CPU
20 | {29FE9562-AC3F-41CD-9B5B-8E75A407FC10}.Release|Any CPU.Build.0 = Release|Any CPU
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/example/ExampleShortcutBadgerApp/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");
--------------------------------------------------------------------------------
/example/ExampleShortcutBadgerApp/ExampleShortcutBadgerApp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net8.0-android
4 | 21
5 | Exe
6 | enable
7 | false
8 | enable
9 | ExampleShortcutBadgerApp.ExampleShortcutBadgerApp
10 | 1
11 | 1.0
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/example/ExampleShortcutBadgerApp/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using XamarinShortcutBadger;
2 |
3 | namespace ExampleShortcutBadgerApp;
4 |
5 | [Activity(Label = "ExampleShortcutBadgerApp", MainLauncher = true, Icon = "@drawable/icon")]
6 | public class MainActivity : Activity
7 | {
8 | protected override void OnCreate(Bundle? bundle)
9 | {
10 | base.OnCreate(bundle);
11 |
12 | SetContentView(Resource.Layout.Main);
13 |
14 | var editText = FindViewById(Resource.Id.badgeValue);
15 | var button = FindViewById