I am developing a data-logging app using Android Studio. I want to save a file that will appear on the user's home screen.
Is there a way to save/write a text file that will appear directly on the home screen of the phone, rather than in internal storage? I don't want to just create a shortcut—I actually want the file to be saved on the home screen.
Is this possible? If so, how can I do it?
This isn't possible. The Android home screen (also known as the launcher) is just an app like any other app. It doesn't correspond to any location on the filesystem where you could store files.
A user may have multiple home apps installed (though only one can be set as the active one) each with their own independent home layout. Some launcher apps don't even take the sort of traditional icon-centric approach to a home screen that you may be used to.
The only way to achieve this feature would be to do what you said you do not want to do: create a shortcut that opens the file.
Related
I developed an Android Package Manager (I know there are a lot on the play store...). With intent "android.settings.APPLICATION_DETAILS_SETTING" and its parameter "package:xxx" I am able to display android settings for that application.
But I would like to be able to open directly storage setting of it without displaying first screen in order to clear cache more easily without too much interaction.
Unfortunately, I didn't find any specific intent going to that "sub screen" in https://developer.android.com/reference/android/provider/Settings.html
Any idea ?
Thanks
Just out of curiosity, I wanted to know where on the file system of an Android device the application icons are stored.
Like I have shortcuts to various applications on the homescreen of my device, where those icons files (or images) are stored. Is it only inside the application package (.apk) or Android stores it some where else?
If it is in application package only does Android loads all the imagess from each of the apk and loads it when it is started for the first time?
When an app file is installed, the .apk file is analyzed and various items of information are extracted by the launcher. (This process does not involve loading and running the app itself.) Among these items is the app icon, which the launcher typically caches in its own private area. Exactly how this is done depends on the launcher currently active on your device. You might be able to browse through the source for your launcher to find out more details about how it caches these items extracted from the app .apk files, but I'm not sure what practical use there would be to that exercise.
The launcher's use of its own cache greatly speeds up start-up, as otherwise every installed app would have to be scanned at every reboot to extract the requisite information for the launcher to show itself. However, the cache is the source of occasional problems, such as the icon not updating right away when an updated app (with a new icon and possibly a new app name) is installed. (See, for example, this thread and this one.)
Think about what happens when you create your own app. Typically, you create icons for your app for all drawable resource buckets (or at least the ones you want to support). Then these files get packaged with AAPT into the apk with the rest of your project. Then after installing your app, the OS will pick the icon that matches your phone configuration and create a shortcut on your installed apps page.
I'm wanting to include some wallpapers and custom icons with my next application update. What's the best way to go about that in Android? I've been doing some searching but I haven't seen anything satisfactory.
Thanks.
Just change the icon and the background and update the app. Or do you mean something else?
I know if your app moves/copies the files to the user's SD card then the media scanner should pick it up and include in the Gallery app. Which can then be used as a wallpaper. But as for using them directly from your app, I'm not sure.
Might be good to not include them in the app directly, but allow the user to choose to download them from within your app (if you have a server or external site you can host them on). That would keep the size of your app small, and allow you to download them directly to the user's SD card.
i'm really freaking out cause i don't know how to find example or documentation for my issue. I developed a kind of Ndroid Market that let you download .zip file and save the in the sd (ex root\download). Each zip contains an icon and an html web application (ex. Icon1.ico and Application1.html). When the download is finished MyMarket unzips the application1.zip file and puts it in a folder.
What I would like to do is to find out how to add the application1.html to the list of my application using icon1.ico as icon, basically I'd like that if someone clicked on the menu button of the phone in the list of my application is shown one with the icon1.ico image, but how to to that? I can't find any code example.
And then the second step. I have to develop both this alternatives and then someone else will choose beetween them
When i click on the icon1 on the list application the default browser is opened and the html application is run inside it....
The most difficul, when i click on the icon1 MyMarket Application is opened but with a parameter, like when in java you run program1 but with one argument that you can retrieve in the argv array. So for esample if i click on the MyMarket icon or on the Icon1 icon the same application is started but then MyMarket check if the "argv" is empty and if it's not and for exmaple there is a string "application1" it open another activity with a webview and run the html file inside it.
but how to to that?
That is not possible for most home screen implementations. The only things shown in a standard launcher are activities, from APK files, flagged as belonging in the launcher. You cannot create these on the fly.
You are welcome to make your own home screen that offers your desired behavior as a feature.
How can I open a folder navagation in my Android apps. I dont want to use any third party app like AndExplorer or ASTRO.
I want a button in my app and when click on it,a particular folder may be ("/sdcard/mywebfolder") should upen and user then can browser its content.
Please help me to accomplish it.
Thanks
Parvendra
Well without the use of third party apps you are going to need to code a file explorer or at least a view to display a certain folder's contents.
You could always just let the user select the program for the browsing via an intent, but I could understand not wanting to do that. Only downside is it means more work and more coding.