internal

How to get FileInputStream for internal memory files in Android ? The file is in my custom folder made in application space

元气小坏坏 提交于 2019-12-06 04:23:31
问题 How to get FileInputStream for file in internal memory in android which is not inside applications default file directory. I have created new directory in my application space. So openFileInput("filename") will only work for files in getFilesDir() . And openFileInput("filename") do not accept argument with path separaters "/" so I can change it to ../myfolder/. Is there any way to get a FileInputStream on this ? .. Note: Using normal APIs File = new File(... ) gives permission denied errors.

Property Injection with internal setter

可紊 提交于 2019-12-06 03:34:31
I have an existing application that I am modifying to use Autofac Property Injection. It seems regardless of which method I use to register my types with properties, the properties are always null unless they have public setters. With other IoC containers (e.g. Structuremap) it's possible to scope the setter internal and make it available using the InternalsVisibleTo attribute on the assembly. This would seem nice to restrict clients from modifying the assignment. Is this possible with Autofac? Or is there another approach when working with property injection to keep the assignments secure? I

How to use Internal Storage of Android in Xamarin?

人走茶凉 提交于 2019-12-05 20:55:18
I want to be able to use Android's internal storage. I found some code snippets like: string path = Application.Context.FilesDir.Path; var filePath = Path.Combine(path, "test.txt"); System.IO.File.WriteAllText(filePath, "Hello World"); But I could not figure out what Application is in here. Is there any solution for that or different perspective? Thanks :) Use this: string path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); string filename = System.IO.Path.Combine(path, "testfile.txt"); // Write using (var streamWriter = new StreamWriter(filename, true)) {

Binding to internal ViewModel-Property

若如初见. 提交于 2019-12-05 19:45:34
问题 I have a UserControl with a ViewModel class as DataContext: XAML <UserControl x:Class="DotfuscatorTest.UserControl.View.UserControlView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" > <StackPanel> <TextBox Text="{Binding ViewModelProperty}"/> </StackPanel> </UserControl>

What is this CopyPDBs function (from clr.dll) doing?

ぃ、小莉子 提交于 2019-12-05 19:03:04
问题 When using Process Explorer to analyze an ASP.NET MVC application in a production environment running IIS, I've noticed a lot of calls to this CopyPDBs function from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll : All of them are having the exact same stack trace: ntdll.dll!ZwWaitForSingleObject+0xa KERNELBASE.dll!WaitForSingleObjectEx+0x98 clr.dll!GetMetaDataInternalInterface+0x3064a clr.dll!GetMetaDataInternalInterface+0x30732 clr.dll!GetMetaDataInternalInterface+0x306e5 clr.dll

Android - Why my saved image is not appearing in the default gallery of my phone?

跟風遠走 提交于 2019-12-05 16:36:36
I am trying to save an image from my application to the default gallery of my phone. The code below works perfectly if I have a SD card on the phone. The image saved appears in the phone's gallery and everything, as expected: private Uri saveMediaEntry(File f, String title, String description, int orientation, Location loc) { ContentValues v = new ContentValues(); v.put(Images.Media.TITLE, title); v.put(Images.Media.DISPLAY_NAME, title); v.put(Images.Media.DESCRIPTION, description); v.put(Images.Media.ORIENTATION, orientation); String nameFile = f.getName(); File parent = f.getParentFile() ;

Saving public files in the internal storage

北城余情 提交于 2019-12-05 15:25:05
问题 I have an application that saves files downloaded from a server. These files are not private to my application and should be accessible to other applications as well. I want to know what would be the correct path to save these files when the SD card is ABSENT. For the SD card, there is the well known API - getExternalStorageDirectory() For the application's private data in the internal memory there is - Context.getFilesDir() On some devices, the internal memory is represented by /emmc/. It

What is the equivalent of a 'friend' keyword in C Sharp?

£可爱£侵袭症+ 提交于 2019-12-05 09:51:40
问题 What is the equivalent of a 'friend' keyword in C Sharp? How do I use the 'internal' keyword? I have read that 'internal' keyword is a replacement for 'friend' in C#. I am using a DLL in my C# project that I have the source code for and yet I do not want to modify the existing code. I have inherited the class and I can use my inherited class any way I want. The problem is that most of the code in the parent class has protected methods. Will using a friend somehow make it possible to access or

How to use internal links with wildcard items in Sitecore?

霸气de小男生 提交于 2019-12-05 09:42:23
I have a multiple site Sitecore solution. All the sites share a product range which is stored inside a 'Shared data' node that sits at the same level as the root nodes of the sites. The individual product pages on a site use a wildcard item to lookup the product based on the last part of the URL. This means that we can't use internal links in the rich text editor to point to the product page on any of the sites because the product item does not have a specific site URL. Does anyone know of a way to overcome this, or perhaps know of a way to augment the default behavior of interal links? Wesley

Make directories in files internal storage

与世无争的帅哥 提交于 2019-12-05 07:51:19
问题 How do i make directories in internal storage? I tried this: File file = getFilesDir(); this makes me goes to folder "/data/data/com.mypackages/files/" Then i want to make a folder again in that directories, let's say i want to make "myfiles" folder in there so it becomes, "/data/data/com.mypackages/files/myfiles/". Can anyone tell me how? I also tried this: File file = getDir("myfiles", MODE_PRIVATE); It makes the folder, but it was created with "app_", so the directories becomes "/data/data