today is not my day i am stuck with this problem
how can i access other application preference screen from my application by specifying in the preference screen layout using intent or something
what is the better or correct way to do so??????
thanks in advance
regards,
kariyachan
As far as I am aware you are not able to access other applications from your own. That would have huge security implications. Why do you need access to another application anyway?
Applications are separated for a reason. If I download two separate apps that do two separate things, I don't want one of them messing with the other in any way (settings, cache, saved files, database, etc).
Related
I am looking to make my Android application have several different names. Ideally, the name would be different after every time the application was opened, chosen from a predefined list.
Can this be done by having multiple values under <label> in the Android Manifest?
Another approach I was thinking about is to potentially edit Strings.xml, but as many others have pointed out, this cannot be done at runtime.
Does anyone have any ideas on how to achieve this or is it truly impossible? Thanks for the help.
I've got a question more about a strategy to use in order to implement the following requirement.
I need to develop a functionality where a user can perform some actions in the application like posting photos, commenting on photos etc. Every of this actions should leave a log somewhere and after entering one of the screens in my app, all the logs should be visible chronologically (the latest first). I've used a TreeSet sorted by item date and it works pretty fine. The problem is to keep this data persistently so that there's a never ending history of logs. I'm reluctant to migrate my code to SQLite unless it's necessary.. I like quite a lot my TreeSet structure thanks to its methods I managed to keep the logic simple. The problem starts when I'm to save this object across different launches of my app....
Has any one any idea how to solve it? Maybe TreeSet is a wrong decision though?
Putting the Logs in SQLite isn't a bad idea. Your other options is to put them in a file, and keep writing to it. You could then write a class to handle sorting it which shouldn't be too bad. The added benefit of using SQLite would be that sorting by Date would be a breeze. But then then exporting it would require the extra work, while having it already in a file makes it easy. So its really just a preference.
I have android application that is written "regular" way. layouts, java, APK.
Now, depending on some factors I want data to be presented differently to different users with different preferences, etc. Doing it using XML layouts will be very problematic in couple of reasons:
Upgrade issue - we have bunch of users and they not good at upgrading.
Hard to maintain and code.
So, I'm toying with idea of "templates" where we can serve templates from server and just use device to generate those.
Web app won't work because our data available offline in case there is no connection.
There is buttons and stuff that user can press to call regular Activities and do things.
I envision something like:
HTML 5 template with {tags} that I will populate from data. I will receive tempaltes and data separately from server. I will merge that data and display on UI.
Now my question is how do I:
Display HTML5 inside Activity
Intercept button push in HTML in my Java code?
Is this bad idea to write something like this?
It sounds reasonable to me. You can use a WebView for displaying the content. Your app can manage a cache of downloaded templates and other content and display it in the web view either from the web site or from the cache if offline.
I think your objections to layouts are offbase. You really might be better off with layouts. Here's why:
Your app can be set to auto-update by users if you do not change permissions. But pushing updates to your app will remain an issue unless your app is entirely web-based. (not a bad approach by the way) But so long as you have a native app, you will need to push updates from time to time.
And as far as being hard to maintain and code, layouts are specifically designed to make this type of customization manageable. You can break pieces of the layout common to different settings into separate files, and add them with includes.
You can use fragments to adapt to a variety of form factors.
You can serve up different layout based on screen size, language, orientation, or any of a wide variety of variables.
Check out some of the series on layout tricks, and get more familiar with being a layout power user. I think in the long run it will save you a lot of effort, assuming you don't switch to making your app a web app instead.
http://android-developers.blogspot.com/2009/02/android-layout-tricks-2-reusing-layouts.html
http://developer.android.com/resources/articles/layout-tricks-merge.html
http://android-developers.blogspot.com/2009/02/android-layout-tricks-1.html
http://www.curious-creature.org/2009/03/16/android-layout-tricks-4-optimize-part-2/
Google: Android Layout Tricks.
Great stuff.
Another benefit: Compiler checking. No broken functionality because a variable or field has the wrong name. Not the case with HTML.
Another benefit: works offline too with no messing around.
And last - you will have a non-trivial amount of work attempting to get this hybrid HTML stuff working the way you want, and then have a very unusual and custom code base that nobody here on Stack Overflow will be able to help you with. Stick with Layouts and there are lots of experts who can help you tackle the stickiest layout puzzles.
I've seen this functionality in many apps in the market, such as ADWLauncher. You install an app but then you can then download apps that only serve to theme the first app. I'd really like to do this in an app I've made but I have no clue how to do it.
The simplest solution would be to simply include all possible themes into the main application and then "unlock" them based upon what other apps are also installed. This is a non-preferred solution because the addition of more themes will make the app bigger resulting in wasted space. This also prevents 3rd parties from coming up with their own themes.
Another solution would be for the resources and classes from the themed app to be loaded in by the vanilla app, but I have no clue how this could be accomplished.
Is there another way that this could be accomplished? What is the suggested mechanism to do this? Any input will be greatly appreciated.
Similar questions have been asked before but with no response:
https://stackoverflow.com/questions/3772440/android-how-to-allow-third-party-developers-to-skin-my-app
https://stackoverflow.com/questions/3771923/android-possible-for-one-app-to-provide-styles-themes-for-another-app
I'm curious about this too. My best guess at the moment though is to make sure all of your UI controls are drawables, not just stock spinners / sliders / etc. Use drawables for the graphics in the UI, and when you publish your apk, those resources should be not only visible but changeable by others. Then again, I'm not 100% sure, so don't quote me on that lol.
I have been looking all over for an example on how to do this but as far as I can tell there isn't a way to share resources and code between packages. The best solution I can find is for one package to provide its resources for other packages by way of a ContentProvider.
You can get the resources of other applications by using this code snippet
context.getPackageManager().getResourcesForApplication(String appPackageName);
GOAL
Hi, I plan to include in all my aps a "credits" button that will display my logo, URL, etc.
PREFERRED SOLUTION
In order to be more effective I would like to have it as an independent app, so that if I later modify it, all the apps calling it would get updated to the same credits display, instead of modifying each of them.
ALTERNATIVES
*(a)* Of course the easy solution is to copy it within each of my apps and update manually each of them. I think this is not so effective when the number grows.
(b) Having a kind of external resource like a mobile adapted webpage which would always be called. I would only need to change it. But I open then the workfield out of android.
My first idea is to have to define it as an independent activity and get it called from each of the apps.
I have two related questions:
1. How do I ensure this "credits" activity gets installed with an application (is there a kind of dependency which can be defined?)
2. Is this a reasonable way of doing it within Android context?
Thanks.
PREFERRED SOLUTION In order to be more effective I would like to have it as an independent app, so that if I later modify it, all the apps calling it would get updated to the same credits display, instead of modifying each of them.
No user will download this, so do not bother writing it.
How do I ensure this "credits" activity gets installed with an application (is there a kind of dependency which can be defined?)
There is no way to accomplish this.
Is this a reasonable way of doing it within Android context?
No. As #bigstones suggests, use an Android library project.