Android changing the app web service Url and icon and name pragmatically - android

I have an application with the following configurations: (let suppose)
1) App name <"ZPE Location Aware">
2) App icon <"given by the company">
3) App Web service url <"will be embeded in Application">
Note: this web service url is the url which will be used to make the web service call to perform different task.
Now we have this app , an Idea is that , when we are giving this app to our other customer then the App name should get change by web service to the other let say from "ZPE to MPE" and also the app icon gets change so also the url should be change
Now please tell me how can it be done ? I am reading about build flavor but it does not look like my case.
So how can this thing be done ? what is better approach to perform this task ?

App name and icon are written inside the manifest.xml file, and this file is encoded in the apk (you can open it as a zip file if needed).
So there are no real ways to change the app information runtime, the only way is to distribute a different apk.
Anyway, you can browse this answer, that suggests you how you can substitute an icon through a listener; this is not a real "icon change", and you will always have a standard icon that is visible before it is temporarily changed by a runtime program.
Update:
As soon as you have Android Studio installed and the source code of the app, you can:
change app_name inside strings.xml
change the url that you can put inside strings.xml too
change the icons inside mipmap_* directories.
make a new apk
It's rather a fast work that can be done in 2 minutes, so I don't see a big problem in it. You could even automize it with gradle, but I think it isn't worth the work.

Related

Android & iOS: Best way to create multiple similar apps

I've created an app which pulls data from a JSON file and displays it.
Now that app is specific for one sports team. I want to create the same app for 10 other teams.
Plus there will be an accompanying pro version of the app.
I'll be doing the same thing for the iOS version.
The only difference between the apps will be colors, logos and url of the data source.
I wanted to know if there was a better way to create apps. Instead of individually creating 40 different projects.
It will help me in updating the app as opposed to copy pasting the same code 40X.
Are there any special features available in eclipse and xcode to do that?
Thanks
I would simply swap out the resources for each team and rebuild the app.
For example, with Android, maintain an AndroidManifest.xml and a res/ subdirectory tree for each team. When it is time to build, simply copy over the resources into the project, overwriting the previous team.
I don't know of any existing tool to do this automatically, however.
Have you looked into using PhoneGap and just create a "mobile site" that detects the app that is connecting and adjusts the data/styles accordingly.
There's always the possibility of creating ONE app allowing the user to set the team preference upon first load, and swapping out resources programmatically.
With Titanium Studio you can write code using Javascript and it convert your code in native objective-c code, native android code, native html 5 code and soon also in windows phone code. It`s the best free cross platform IDE
Upon reviewing your responses, you seem to want a strategy to manage your resources. Since different OS has different resource requirements (screen-size, iOS 2x png for example). The most common strategy is to keep a separate resource structure and setup build target to copy/xcopy replace these image resources before build. Source control + an OSX build server would be most beneficial.
After creating these apps I've found the following way to be the most easiest way to create a similar app.
Android:
1. Select the project from the project explorer sidebar copy it and then paste it. Give it a new name.
Select the new project and then right click > Android Tools > Change Package Name.
Give it a new package name. Eclipse will give you an option to refactor the code, say yes.
Go to res/values and change all strings.
Change the icons and other images.
Go to src click the package and then refactor it. Give it the new package name.
Go to manifest file and rename any old names which might still be lingering.

Can't download cilent generated file in Android Chrome

Ok, there's a long history behind this one, but the gist is that we need to create and download a little bit of text CLIENT side, into a file called "test.lbl". Assume we can't access the server side.
The following code (coffeescript) does this by creating a Blob, converting it to a data url, and then clicking the link. This works GREAT in a desktop Chrome browser. However, in Android Chrome (not sure what version exactly, but I just installed it as of 3/5/13 from Google App Store) this simply won't work. In Android Chrome, the file starts to download and then just spins. (In fact, it shows in your "Ongoing" for quite some time, even after the browser is closed.)
Anyone know why this might not work in Android? Perhaps a different mime type will make it allow the file to be downloaded? We're dealing with internal tablets so we can relax any site specific security settings we need to.
Or, is there a better way to go about this entirely? (client-side generated text file download)
Thanks
$("#get-label").on 'click', (e) ->
e.preventDefault()
bb = new Blob(['test test test'], {type:'text/plain'})
evt = document.createEvent("HTMLEvents")
evt.initEvent("click")
$("<a>", {download: 'test.lbl', href: webkitURL.createObjectURL(bb)}).get(0).dispatchEvent(evt)
This is a known issue in Chrome for Android. I have raised an issue https://code.google.com/p/chromium/issues/detail?id=181032 - if you star that you will be able to see all the updates for it.

Android Development: How To Add App To The Application Chooser?

Basically I want to add my application to the application chooser list for files with the type .php, .java, .js, .html etc. so that users can browse for a file using any file browser and use my app to open it.
I've looked at tutorials for Broadcast Receivers but none of them have shown how to do this, they've just shown how to listen for the phone state changing and stuff.
Help! :(
Thanks,
Alex!
Although I never used it, I think this might help you: Intent-Filters.
And also this thread from anddev.org.

Providing themes as an add-on (additional download, image sets) for an app

I've got an Android app that can be themed using a set of images. It lets users select which style of images to use, but in order to keep the main app small and let users download/manage only the additional image sets that they would use I want to offer add-on downloads (like extensions).
What's the best way to do this? Thanks in advance.
Well, Handcent, a mms app that I use, had all their themes on the market. What I guess they did is just keep the file structure the same and when the user downloaded the apk data folder, it was placed into the already existing apk tree of the primary Handcent application. I have no idea if that's how they did it, but I can't see why it wouldn't be feasible.

Android Installation of APK via Browser Link

I want to create a web page that has two links. One that downloads the agent itself (which is pretty easy, just linking to the APK file with the appropriate MIME types set), and the other to start the install process for the APK downloaded in step one.
I know they can just pull down the bar and click on it, but that can be confusing for users (especially in the overall process we are trying to create). Is there a special URI I can use to start the installation, sort of like the market link of "market://"?
Also, is there a way to get meta-data surrounding where the APK was actually installed from? For example, if the link for the APK is "http://company.com/setting=123", that I can pull in the "setting=123" from the URL? I suspect not, but I figured it couldn't hurt to ask.
You can add url interceptors to your app like it's mentioned here but AFAIK there is no way to do what you are asking.
check open2go.com
it may help you.
example here
http://open2go.com/http://m.getjar.com/mobile/49757/angry-birds-seasons/
open2go.com/ + url
market: schema works to.

Categories

Resources