Comments (6)
Current, you should pass a absolute path to FlutterNordicDfu.startDfu
like /data/local/tmp/file.zip
.
In plugin, it use File(path)
to open it
from flutter-nordic-dfu.
@fengqiangboy Absolute path from the root of the app?
Should It be updated in the pubspec.yaml
as well?
Example would be much appreciated 😄
As you have used assets/file.zip
in your example itself
from flutter-nordic-dfu.
In early version, I use assets/file.zip
to test, because at the time I use a tool to get Asset file in native code, but it would import third dependent, so I remove it now.
I will consider how to achieve better implementation that can get flutter assets file path in native code.
from flutter-nordic-dfu.
Oh, which plugin did you use earlier? can you also give me an estimate on how long will you take to implement your version of the same?
I'll keep this issue open until then.
from flutter-nordic-dfu.
Use com.blankj:utilcode,
the code look like:
// assets file from flutter
filePath = "assets/file.zip"
filePath = registrar.lookupKeyForAsset(filePath)
val tempFileName = PathUtils.getExternalAppCachePath() + UUID.randomUUID().toString()
// copy asset file to temp path
ResourceUtils.copyFileFromAssets(filePath, tempFileName)
// now, the path is an absolute path, and can pass it to nordic dfu libarary
filePath = tempFileName
from flutter-nordic-dfu.
Current, it can support asset file in flutter, you can try it in version 2.0.0
await FlutterNordicDfu.startDfu(
'EB:75:AD:E3:CA:CF', 'assets/file.zip',
progressListener: ProgressListenerListener(),
/// asset file should add this parameter
fileInAsset: true,
);
from flutter-nordic-dfu.
Related Issues (20)
- iOS dependency is old and causes troubles on iOS HOT 3
- Is there abort function? HOT 2
- Multiple Downloads HOT 1
- Why is ACCESS_COARSE_LOCATION required ? Is it possible to avoid it ? HOT 2
- Conflicting info in readme and pubspec.yaml
- PlatformException(2, DFU FAILED, ...) on DFU attempt HOT 1
- Add null safety support HOT 1
- DFU not working on iOS HOT 1
- No Null safety version for flutter yet HOT 1
- Flutter 2.5.0 - Android embedding deprecation warning HOT 2
- Some DfuProgressListenerAdapter events are not fired HOT 1
- Please make new release version HOT 1
- Android 12 Support HOT 5
- warning about Android V2 embedding HOT 3
- Could not resolve no.nordicsemi.android:dfu:1.11.0 HOT 2
- Android 12 issue HOT 3
- Support for web
- The plugin `flutter_nordic_dfu` uses a deprecated version of the Android embedding.
- PlatformException(2, DFU FAILED, device address: "E2:49:1A:4D:64:C3", null) when use flutter_nordic_dfu: ^3.0.0
- DFU is leading to an infinite loop
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter-nordic-dfu.