Flutter permission handler showing different app name - android

I am using permission_handler plugin to get access of gallery and media for image upload. Issue is the permission dialog showing different
in android.xml file i have
android:name="DOR"
android:label="DOR"
and in build.gradle and I have DOR in my app name Don't know why I get this WPS Office

Click on Ctrl + shift + f(windows) or cmd + shift+f (Mac) and find WPS office. If you find it somewhere please replace it. If you don't find it and invalidate cache and restart. Run flutter clean and then build the app

Related

I get an error when I try to run my flutter app

this is the error that I get when I enter run flutter in the command line
+ CategoryInfo : ObjectNotFound: (run:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Any ideas how can I fix it?
I deleted and reinstalled android still thinking that it was a problem with the version I'm using but it still not working
From the error message, it looks like you are using a Windows system. Make sure you have downloaded flutter and added its bin folder to the Path variable.
This can be done as follows:
Press the start button and type env
Open "Edit environment variables for your account"
Look for an entry called Path. If it does not exist, click "New..." to create it.
Click on the Path item and the path to your flutter/bin folder C:\<your_path>\flutter\bin

Android Studio Get Application Directory dataDir

In other Apps I can access files in directories like /storage/emulated/0/Android/data/com,xxx,yyy/files
In my own app I want to use it too. But with getApplicationInfo().dataDir I receive /data/user/0/com.xx.yy/files
How can I receive the path to /storage... and how to create this directory (it was not create automatically after installing the App)
Now I find out that getExternalFilesDir(null).getAbsolutePath() do the job

Python automated script file transferring

I am looking for a solution for copying all the files from a specific directory on the hard drive, to a specific or non specific directory on my android phone, once this device is connected.
I would like these files to be automatically moved (or at least copied) to my phone once I connect it to the computer and run the .py file.
I have windows 7 and python 2.7
I was trying this from another answer but I can't understand because there is few explanation, therefore I cannot get it to work.
edit: I have figured out how to transfer files between to folders but I want to my phone. So how can I fix the error of my system not finding the path of my phone, that'll fix my problem I believe. The code works fine the problem is the path.
Here is my code:
import os
import shutil
sourcePath = r'C:\Users\...\What_to_copy_to_phone'
destPath = r'Computer\XT1032\Internal storage'
for root, dirs, files in os.walk(sourcePath):
#figure out where we're going
dest = destPath + root.replace(sourcePath, '')
#if we're in a directory that doesn't exist in the destination folder
#then create a new folder
if not os.path.isdir(dest):
os.mkdir(dest)
print 'Directory created at: ' + dest
#loop through all files in the directory
for f in files:
#compute current (old) & new file locations
oldLoc = root + '\\' + f
newLoc = dest + '\\' + f
if not os.path.isfile(newLoc):
try:
shutil.copy2(oldLoc, newLoc)
print 'File ' + f + ' copied.'
except IOError:
print 'file "' + f + '" already exists'
I am sorry I am being handful but I thought I had solved it.
In theory, there is no way to access your phone's internal memmory with a drive letter, because, Android connects as an MTP device, and not as a Mass Storage device. But, there are some weird solutions:
Root the phone and get a application which enables "Mass Storage" .
If you can not root and if(only if) both the computer are on the same network, run FTP server in you phone, and you get access for file copy by ftp.
But for you case I recommend adb- adb push C:\src /phone_destination is the best solution.You can google and easily find out way to do this in python.
Google offers adb-sync, which is also available in python. This allows backup/synchronization of files on android device to PC.
The following github repo provides instructions on how to setup the process ie: enable USB Debugging, etc... however I suggest installing 15 second adb installer as opposed to downloading/installing the massive Android SDK just to get adb.
adb-sync: https://github.com/google/adb-sync
15 Sec ADB installer: https://forum.xda-developers.com/showthread.php?t=2588979
A little late to answer, but I use SSH certs and crontab to run a ping command against my local IP and pipe that to an scp recursive copy. It will copy any changes over. No issue yet, and it's been running 4 years straight. I can't for the life of me find the command line that's running.

Can't locate application data on Android phone

I have spent many hours trying to find/create files for an app I am writing. When I pull the application directory name I get: /data/data/com.example.android.[myapp]/files. I am using File(getFilesDir():
File fileDir = new File(getFilesDir() + File.separator);
Log.i(TAG, "File directory: "+fileDir);
When I try to find this path I find many application folders here: Android/data/com but no /data/data folder under Android. There are many other application folders there but not mine. I see the same results whether I use Android Files app or Windows Explorer over USB. I've also tried to look using Eclipse DDMS tab. I see a data folder with a (+) to the left but when I click, it does not expand.
I have also tried creating the directory and file manually with Windows explorer and my app still can't find neither the Android/data/com.example... nor the Android/data/data/com.example... paths.
Also puzzling to me is when the app creates the path and file and write to it (using MODE_WORLD_WRITEABLE) I get no exceptions thrown but then I am unable to read it back or see it with either of the tools mentioned above. I have set the manifest permissions to WRITE_INTERNAL_STORAGE and WRITE_INTERNAL_STORAGE for the app.
Obviously, I am making a very basic mistake.
I am on Android 4.1.2 (API 16).
Sincerely,
ScratchingMyHead
To get the path of my application directory, Try this code sample
PackageManager m = getPackageManager();
String s = getPackageName();
try {
PackageInfo p = m.getPackageInfo(s, 0);
s = p.applicationInfo.dataDir;
} catch (NameNotFoundException e) {
Log.w("yourtag", "Error Package name not found ", e);
}
When I try to find this path I find many application folders here: Android/data/com but no /data/data folder under Android.
That is because you are looking on external storage, not internal storage where your files are. Use DDMS on an emulator to examine internal storage.
I've also tried to look using Eclipse DDMS tab. I see a data folder with a (+) to the left but when I click, it does not expand.
That would sound like what you will get when testing on hardware, as neither you nor DDMS have access to the contents of /data on production hardware.

Phonegap 3.3 resolveLocalFileSystemURI Cannot get Android data/data folder

I used to be able to run this without problem to get to the databases folder of my Android App:
window.resolveLocalFileSystemURI('file:///data/data/{package name}/databases',
function (entry) {
alert(entry.fullPath);
}, rlfsOnErrors);
However, the statement returns error when I am using file-transfer plugin v0.4.2. When I switched back to file-transfer plugin v0.3.3, there is no problem. When I am using v0.4.2, I can only gain access to file:///data/media/xxxx directory and not file:///data/data/xxxx.
Anyone has any idea how I can workaround this ? Currently, I am sticking to v0.3.3, but I am sure there is some way to workaround this ?
Thanks.

Categories

Resources