Android :: Setting APK Configuration In Activity

Aug 26, 2009

In Java ME we can set .jad configuration in description file and we can get this values in midlet by getAppProperti(""); So in Android we can set apk configuration (eclipse) apk configuration. But when I set this! my file default properties change and my projet signal some error. So in activity when can add System.setProeprty("name","values"). My problem I wan to specify the server IP and some code in apk only for this apk file. Each apk can have his code and server IP.

Android :: Setting APK Configuration in Activity


Android :: Setting Connection Priorities Using Wifi Configuration Priority

May 20, 2009

I am trying to to use WiFi API to set priorities to created profiles. I am using the priority field of WifiConfiguration to set this information. I have found out that no matter what priority I set, Android always tries to re-connect to the latest access point that it was connected to. Here is what I do: 1) I create a profile A with a very low priority (0) 2) I create a profile B with high priority (100) 3) I connect to profile A 4) I turn Wi-Fi off 5) I turn Wi-Fi back on 6) In the scan Android sees both A & B 7) Android connects to A, even though its priority is much lower. Does anyone has a work around for this?

View 2 Replies View Related

Android :: Force An Update In A Configuration Activity

Sep 29, 2010

I'm writing a widget with a configuration activity which calls the following method when its OK button is clicked:

CODE:..............

This is almost verbatim from the documentation. widget_id holds the widget ID that was dug up during the activity's onCreate().

When I place an instance of the widget on the home screen, I've verified that I get the expected sequence of events:

onReceive() gets an ACTION_APPWIDGET_ENABLED if it's the first one.
onUpdate() gets called (in which I detect that the widget isn't configured and draw something as a default action).
The configuration activity appears.
When I press OK, the ok() method above gets called.

The method gets all the way through to the finish() and the configuration activity goes away, but there's no call to onUpdate() or onReceive() after this point. (The widget itself has no updatePeriodMillis.) I end up with a widget on the screen that has the results of my default action but never gets updated.

If I set the widget up without a configuration activity, it gets updated when created and everything works as expected (just without the configured bits).

View 1 Replies View Related

Android :: AppWidget Configuration Activity Required?

Apr 15, 2009

I'm playing around with the new AppWidget API, I get the impression from the docs that I don't need an android:configuration attribute in my AppWidgetProviderInfo xml resource. Curiously though, when I try to add my AppWidget to the home screen, I just get a black textview that reads "Problem loading widget".

View 2 Replies View Related

Android :: Add Widget Configuration Activity To Launcher?

Oct 17, 2010

I have a widget with a configuration activity.

Currently the configuration launches when you click on the widget.

I want to add the configuration as an app icon to the launcher.

The problem is that when the configuration launches on click, I get a specific widget id , so each widget instance can have a different configuration.

What will happen if I start the activity from the launcher?

I wont be able to show multiple configurations on the same activity.

View 1 Replies View Related

Android :: Widget Configuration Activity - Update Request

Sep 18, 2010

I'm having an issue with a config activity for a widget. According to the dev docs, if I specify a configuration activity than the onUpdate method of the AppWidgetProvider doesn't get called until after you request an update once you've completed the configuration activity. For me its happening in reverse, the onUpdate method of the AppWidgetProvider gets called first, followed by the configuration activity. Then the onUpdate method is never called after completion of the config activity even though I request it explicitly. I tried with level 4 and level 7 API, same result. Here is some of the source:

Manifest:
<?xml version="1.0" encoding="utf-8"?> <manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.chris.android.swidget"
android:versionCode="1" android:versionName="1.0">
<application android:icon="@drawable/app_icon" android:label="@string/app_name">
<activity android:name=".SWidgetConfigure">
<intent-filter> <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter> </activity>
<receiver android:name=".SWidgetProvider" android:label="@string/ widget_name">
<meta-data android:name="android.appwidget.provider" android:resource="@xml/swidget_info"/> <intent-filter> <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter> </receiver>
<service android:name=".service.PUpdateService" />
</application> <uses-sdk android:minSdkVersion="4" />
<uses-permission android:name="android.permission.INTERNET" />

</manifest>
swidget_info.xml: <?xml version="1.0" encoding="utf-8"?> <appwidget-provider
xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="294dp" android:minHeight="72dp"
android:updatePeriodMillis="86400000"
android:initialLayout="@layout/swidget_layout"
android:configure="com.chris.android.swidget.SWidgetConfigure" >
</appwidget-provider>

I can include source of the onUpdate method from the AppWidgetProvider activity and the onCreate method of the configuration activity if necessary, but they are both being called find its just the order they show up on the emulator is wrong.

View 5 Replies View Related

Android :: Save Configuration Value As Integer In Preference Activity?

Sep 16, 2010

Is there a way how I can tell the Preference Activity that value should be saved as integer? So far my all values are saved as strings... I can limit input to integers via XML easy:

<EditTextPreference android:key="SomeKey" android:numeric="integer" />

but it is still saved as string and later trying to getInt("SomeKey") on preferences object I always get java.lang.ClassCastException: java.lang.String.

Is there a way that EditTextPreference value would be saved not as string? Or maybe I should use some other type of Preference for numeric input?

View 7 Replies View Related

Android :: Setting Theme In An Activity

Jun 6, 2010

The background image is not getting loaded but the text color and textViewStyle got changed. The background image remains the defalult one -blank screen.If I am setting the theme in android manifest file then it works properly.Can anybody tell me the reason for this?

View 3 Replies View Related

Android :: Setting Layout XML File To New Activity

Aug 18, 2009

I created a new Activity and created a new layout file under res/ layout . after this,i also want to add a options menu file under res/menu.but how could i bind all these layout file with this Activity? I can't find any info in manifest file. or i missed it?

View 3 Replies View Related

Android :: Setting Activity Orientation By Code?

Nov 24, 2010

It is possible to set the orientation of an activity in the manifest file. but is it also possible to do it from code? if so, how?

View 2 Replies View Related

Android :: Setting Preferred Home Activity From Application Code

Jan 7, 2010

I'm trying to have my home-screen application register itself as the default home-screen so the user is not prompted with the IntentResolver's list of all the available home-activities.

This is my code:

CODE:.................

I have the android.permission.SET_PREFERRED_APPLICATIONS set in the manifest. After executing the code above, the logs claim things have been added like expected (same logs as when I tick off "Make default" from IntentResolver's list). However, when I proceed by clicking home, the list still shows up and the logs say:

CODE:.....................

So it seems the resolver deletes the default entry. Am I doing something wrong, or is this a security measure? What are the ideas behind this?

View 2 Replies View Related

Android : Add View Progamatically To Activity's Absolute Layoute Setting It's Possition?

Oct 7, 2010

I have a form with several Views on it, the last one is a Spinner that is bound to an adapter to get it's data from a Web Server via a POST request, at the end I append an additional entry for "Other...". If this option is selected on the spinner, a new EditText View at the bottom where the user enters a custom value, I've managed to get the EditText View to show on the screen, but it's positioned at the very top, over my other Views and I can't seem to find the way to make it appear at the bottom, below the Spinner as I want it to, here is the code I have so far:

EditText suggestCarrierField = new EditText(getBaseContext());
suggestCarrierField.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT));
suggestCarrierField.setHint("Suggest your carrier");

((AbsoluteLayout) findViewById(R.id.createAccountView)).addView(suggestCarrierField);
((AbsoluteLayout) findViewById(R.id.createAccountView)).invalidate();

View 2 Replies View Related

Android : Setting A Layout To Use As Empty View For A ListView In Case Adapter Has Zero Items In A Activity

Nov 16, 2010

How to use a layout as empty view for a listview when the adapter has zero elements?

setEmptyView is not working with this code :

CODE:..............

Layouts used :

CODE:...........

main.xml

CODE:...............

View 3 Replies View Related

Android :: OTA Configuration Supported By OS?

Oct 6, 2010

I would like to know if the Android handsets can be configured Over-The-Air; in other words, if they can be configured for settings (such as GPRS , WAP or MMS ...) using OTA. If yes, do they support OMA CP provisioning? Is there an XML example that can be used to configure the Android devices?

View 1 Replies View Related

Android :: Best Way To Add Configuration UI To Application?

Nov 24, 2010

I have a simple Android application that loads a page in a WebView, then most of the real work is done by the server-side scripts. Everything is working great, except that I currently have the page URL hard-coded in the Android application, sort of like this:
mWebView.loadUrl("https://www.my-application-url.com");

This was fine until this morning when I was asked to to make it so that the user is prompted to enter the URL the first time the application run, and the URL that is entered by the user is then saved and used automatically by the application from that point onward. I was also asked to make it so that the user can change the URL if they choose to do so. The reason I was asked to do this is so that users can install the server side of the application on their own servers and my Android application will be able to connect without me having to write a custom version for each user, with their URL hard-coded into the application.

I am unsure what is the best way to handle this in Android. It seems that I probably need to add some type of configuration interface to the application that is shown by default on the first run, then only when the Menu button is pressed on the following runs. From this configuration interface I guess I would then get the URL from the user and serialize it for future use. What is the best way to accomplish this?

View 2 Replies View Related

Android :: Juice Defender Configuration?

Jul 19, 2010

I've only owned an Android for 6 days (Samsung Galaxy S i9000) and one of the first things I installed was Juice Defender, having used iPod Touch extensively, I know how heavy on battery things like WiFi can be. Anyway, JD makes the phone really really leggy. It can take a minute sometimes (literally, 45-65 seconds) for the JD screen to come up when launched. Similarly when waking from sleep it takes ages for the data connections to become active again. Have I misconfigured JD? Is it really this slow and creates this much lag? Does it just not like the (fairly new) i9000? I've just uninstalled it there right now (left Ultimate Juice on) and the phone is much snappier. It's like using it for the first time. Which, considering JD was installed in the first half hour of my owning the phone, it kind of is. What I really wanted was the WiFi on/off according to cell tower location data so I can have it go on and off when I leave the house. Guess it's no real biggie. Having limited background data (e.g. the 2 mins per 15) is handy too. Are there any other apps which have JD functions - even if more limited in scope - that I can try?

View 2 Replies View Related

Android :: Handcent Configuration Right Settings?

Oct 4, 2010

Having some trouble getting handcent configured right. I want it to only show the notification in the top status bar and the dock. I do not want the popup window. Can someone tell me which settings to use? I have tried everything and cannot get it right.

View 1 Replies View Related

Android :: Configuration Screen When Installing

Jul 10, 2010

I need to display a configuration screen when a user installs my application. Is this possible to implement? That screen should not appear again.

View 2 Replies View Related

Android :: How To Retrieve Current Keyboard Configuration?

Feb 16, 2009

How can I detect if the G1 keyboard is hidden or open at application startup? My app always runs in landscape mode, but I can only find how to detect keyboard configuration *changes* (through onConfigurationChanged()). So how can I retrieve the current keyboard configuration (open or closed) at application startup?

View 3 Replies View Related

Android :: Best Practice For Storing Application - Configuration

Apr 8, 2010

I am still learning bu find Android the cool platform for allot of useful applications. I have written a Service for doing GPS tracking and it consists of a Service and a Control activity to manage, monitor and configure the service. I am looking for the preferred way for the Control Activity to define settings for the Service, things like IP address and Update interval. I envision something like a Registry on windows where these settings can be shares and updated.

View 9 Replies View Related

Android :: Storing Application Configuration Settings?

Oct 12, 2009

Where should I store my Android application's configuration settings? Coming from the .NET world I was expecting something like .config. Do I create a file under res/values, and use that?

View 1 Replies View Related

Android :: Smartphone Memory Configuration - Inbuilt ROM And RAM

Jul 17, 2010

Smart-phones have built in ROM and RAM separately. Also a few phones has virtual memory support too. I would like to know what these memories are basically used for. I understand that RAM is available to user processes. But why do they have a big chunk of ROM? E.g. The wiki page for Droid Incredible says

512 MB DDR RAM
1 GB ROM (748 MB free to user) - what's this free to user?
plus 8 GB moviNAND - typically used for data storage

View 1 Replies View Related

Android :: Configuration Change - Width And Height

Jul 25, 2010

What happens to the width and height params declared in LayoutParams on configuration change? E.g. if I have an ImageView declared with,
new LinearLayout.LayoutParams(30, 40);
On Configuration Change, does the width become 40 and height 30?

View 1 Replies View Related

Android :: Keeping Service Alive Across Configuration Changes

Apr 7, 2010

The default way configuration changes (i.e., rotates) are handled is to destroy the activity & recreate it with a new one. What is the recommended way to handle these changes in an activity that binds / unbinds to a service (that is possibly heavy/slow to start)? When the activity gets destroyed, it unbinds & causes the service to be destroyed. When the new activity is created, it binds & recreates the service.

The only choices seem to be:
-- override onConfigurationChanged in the activity. Feels ok, but non - conformant.
-- explicitly start the service & only stop it when the last activity gets an onDestroy that's not due to a config change (i.e., there was no call to onRetainNonConfigurationInstance). Feels icky.
-- explicitly start the service & don't stop it until some amount of time after the last unbind. Ickier.

On a related note, what happens between activity switches within a process, where the first activity (A) starts the next activity (B) & then calls finish() -- is there a guarantee that B.onCreate is called before A.onDestroy? If not, and the activities share a service, the same issue of keeping the service alive during this window exists, but with only the icky workarounds.

View 7 Replies View Related

Android :: Deploying Custom Configuration With Application

Aug 2, 2010

I have developed an App that talks to a set of web services. Because the App is used in different environments and for different purposes, I would like to provide a way to automatically deploy a configuration alongside the App that contains the settings for the environment (url of the locally hosted web services for example) and App settings (such as a timer period for talking to the web services). It would be tedious to have a UI for this and have to do it on every device post installation. Things I have tried and why they didn't meet my requirements:

*Raw Resource: If I unzip the apk and change the settings file, it becomes invalid as I need to resign the apk.
*Reading straight from the apk with ZipFile/ZipEntry: Device complains upon installation that the config file is not signed.
*PreferencesActivity: Requires device side UI; It would be tedious to have a UI for this and have to do it on every device post installation.

View 11 Replies View Related

Android :: Dialog Survival Over Configuration Change

Mar 4, 2009

Flipping between landscape and portrait is causing me a problem with dialogs that are active at the time of config change. The dialogs survive (which I think is good), but I have the problem that some of my dialogs contain dynamic content which would need to be refreshed in the dialog views. All that content disappears from the dialog views after the config change.

I thought it would be easier to do a dismissDialog() on restoration in onCreate(), letting the user press the button that shows the dialog. I successfully save and recover the dialog id, but when I attempt to dismissDialog(id) I get an IllegalArgumentException: no dialog with id 1 was ever shown via Activity$showDialog. Ok, so that doesn't work, and I still have that messed up dialog up on the screen that I want to get rid of. How can I do that? Are there any other reasonable alternatives?

View 18 Replies View Related

Android :: Icon Configuration Like Crazy Home

Aug 25, 2010

I was wondering if anyone who has tried Crazy Home knows of any application that allows you to switch icons from theme to theme like the Crazy Home launcher. I know of and have Bettercut, but that only allows you to create your own, or replace using a downloaded icon pack. But the crazy home app allows you to choose a theme, then use icons from another theme which bettercut does not allow. It also lets u change and icon to the theme icon. For example the gmail icon is default, but the email icon is themed, it offers the ability to change the gmail to themed.

View 2 Replies View Related

Android :: Create EAP Wifi Configuration Programmatically

Nov 22, 2010

I know how to create Open/WEP/PSK/PSK2 configuration programmatically.

CODE:...........

But how do I create one for '802.1x EAP'?
Looking into the source code at:

CODE:..............

Seems to do the work but 'config.eap' is not accessable from my application.

Is there a way to configure EAP types or is it not possible?

View 1 Replies View Related

Android :: Configuration Changed And Destroying Activities

Jan 9, 2010

I read up on how Android handles "configuration changes" - by destroying the active Activity.The first question I really want to know from Android Team - why? I would appreciate an explanation on how the reasoning went, cause I dont get it =)In any case, the fact that it acts in that way puts us all, as I see it, in a world of pain.Lets assume you have a Activity which presents a number of EditText:s, checkboxes etc. If a User starts to fill that form with text/data and then changes orientation (or get a Phonecall), then all input the User made is gone. I havent found any way to preserve state. That forces us to make extremely painful coding to not loose all data.

View 3 Replies View Related

Android :: Email Application - Possible To Get All Configuration Details

Jan 11, 2010

Is there any way to get in the code:
Email id
Password
SMTP host
SMTP port

Which the user used to setup his Email account with the Android built in Email application. Required because, I am written a MailSender class using JavaMail API there I need to send the mail using the details what user configured in Built in Android Email application.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved