Advertisements:




Reusing Code - Multiple External Namespaces


What's the proper way to share code and layouts between android projects? á(I work with eclipse)

Explanation and my problem:

I'm working in multiple projects that share the same base (an activity-less android project). This project have some graphical classes with its layouts in xml and require both to work properly. Normally i copy this code and change the r. Id definitions on the project to match the current 'sub-project' but, obviously, this is not the proper way of reusing code.

Now i have two eclipse projects, one of them has the 'base' code and the other is the current application. I defined a dependency but it seems that i can refer to the classes from java, but i can't in this other project's layouts. I tried declaring its namespace in xml files, but it doesn't work.

I can't believe the way is copy+paste and search+replace.


View Full Post With 2 Replies

Related Forum Messages:

Please Follow Index to Quick Jump to the Message.


Reusing Tts-object On Multiple - Different Activitys In App

I'm program an android-app for blind people. So i'm using tts on every activity in my app.

I don't want to initialize tts on every activity again because it takes time and resources, so i'm creating a tts-object in my application class and use it on the activitys. It works fine.

But documentation says you have to something like this:

Code:.

But i can't do this because i don't want to shutdown my shared object (each time a activity is destroyed) but if my programm get's distroyed it i should shutdown it.

So: where to call . Shutdown() ? Or does anybody know a better way to ensure that tts is loading quickly?


Posted On: Nov 7 at 13:20 . View Related Posts . . View 1 Replies .

Reusing Layout Xml And The Code Behind

I am trying to turn a couple buttons into a reusable component in android. I have successfully gotten the xml / ui portion working, but i can't figure out how to make code behind it reusable between activities, short of recoding it everywhere.

I've already reviewed this post several times: android layout tricks 3 - part 1 but it seems to be missing a few files, and i do not have enough experience to rebuild them.

A dumbed down version of my main layout:

Code:.

And then of my "component":

Code:.

If you have any additional critiques on my xml.


Posted On: Jul 8 at 18:10 . View Related Posts . . View 2 Replies .

How To Retrieve Paths To Multiple Sd Cards - Internal & External

I ran into a seemingly simple issue to which i cannot find an answer. The application i am working on needs to read/write data from/to the sd card. All the resourcess are located in a folder rigth on the root of the sd card. To obtain the absolute path to my resources directory.

I wrote something like this:

Code:.

Which results into something like:

Code:.

This works just fine for most devices. However, there is the samsung galaxy s which has 2 sd cards, one internal, and one external. Using the code above, i get the path to the internal sd card. The path to the external card is "/sdcard/sd/" (where i belive "sd" is just the mount point).

Is there any api that i don't find which returns a list of paths to multiple sd cards (if available). Or is there any other way to scan both cards for the existence of my resources folder without hardcoding it myself. Note that changing the location of the resources dir is not an option.


Posted On: Sep 30 . View Related Posts . . View 2 Replies .

Samsung Galaxy S - Reusing Launcherpro

I used lp for a while then cleared it as default and then gave tw another go. Now i wanna try lp again but i don't know how to set it as my default home screen again? I can't find it in my app draw? How do i start it again?

Posted On: 09-09-2010, 12:24 AM . View Related Posts . . View 7 Replies .

Reusing A Thread - Get Some Remote Data From Server

I am trying to get my head around threads, and after attempting many times to get my head around it, i am stuck on this point.

I want to get some remote data from a server. I create a thread to handle this operation. I understand this. But if i want to get some more remote data, i end up creating a new thread. This seems a bit daft, as shouldnt i be able to re-use the existing thread.

After trying to understand how i could do this, i think the answer lies in sending messages to the thread? But i am totally baffled by this.

Here is a example of where i need to get lots of remote data based on a variable within a for statement:

Code:.

As you can see in the example, i need to call the remote server lots of times, but instead of creating a new thread each time, shouldnt i be able to reuse one thread that i can create earlier?


Posted On: Oct 10 at 10:40 . View Related Posts . . View 1 Replies .

How To Ping External Ip From Java

I am developing a ping application for android 2. 2.

I try my code and works ok but only in local ips, thats my problem i want to do ping to external servers too.

Here is my code:

Code:.


Posted On: Oct 11 at 10:30 . View Related Posts . . View 1 Replies .

How To Use External Jars In Project

I have created an android project and added an external jar (hessian-4. 0. 1. Jar) to my project. I then add the jar to the buildpath and check it of in order and export.

Order and export is ignored it seams, and all classes from the external jar is missing in runtime.

Is there a trick to properly include the needed classes from an external jar when building an android application using the eclipse plug-in. I do not want to use ant of maven.


Posted On: Aug 26 09 at 13:45 . View Related Posts . . View 4 Replies .

External Storage File Creation

The following is the code that am using to create a small text file on the external storage. But the problem is its saying can't read nd can't write.

Note : bollo() is a method with has a toast to display on the screen dont confuse with that method.

Code:.


Posted On: Oct 11 . View Related Posts . . View 10 Replies .

Google Maps External Library

A not so small part of the android devices are not including the google maps external library. My first question is: how can a vendor/manufacturer include it on his devices, is there a process of obtaining a license for the use of the library or there are some conditions to apply for such a license?

My second one: is there a nicer way to address this issue other than have 2 builds/apks, one that uses the library, with added in the manifest, and the other one, without the use of the library?


Posted On: Oct 20 . View Related Posts . . View 2 Replies .

Possible To Create Droid Database Without External Tools

I have been searching for this for the past few days and every tutorial i see needs for me to use an external package. Is there anything built into the android sdk that would allow me to create a database? I thought i saw something on it a long time ago, but i can't find anything to back that foggy memory up.

Posted On: Oct 5 at 6:59 . View Related Posts . . View 1 Replies .

Close Alertdialog Builder From External Button

Well it's all in the subject :) do u have any ideas about how to dismiss a builder from an external button. I did mybuilder. Create(). Dismiss() inside the onclicklistener of the button. But it doesn't work.

Posted On: May 27 . View Related Posts . . View 3 Replies .

Htc Incredible No Default External Storage

The htc incredible is now available for pre order at verizon. Engadget has already done a review. They mention that there is a storage issue with a lot of apps because it does not come with an external sd card by default. It does have a lot of separate internal storage, but apps cannot use it. Does anyone have more info about this from a developer's point of view. What path will environment. Getexternalstoragedirectory() return and what is the correct way to get the path of the internal storage?

Posted On: Apr 19 . View Related Posts . . View 22 Replies .

Vehicle Dock - Using External Speakers While In A Call

When my phone is in the vehicle dock the sound is pumped out of the car speakers perfectly until i take a call, at which point it reverts to the phone speaker. Whilst the mi've is able to pick up my voice from the cradle, i can't hear the speaker. How do you get it to continue to use the external speakers whilst in a call? Yes, use external speaker whilst docked is selected.

Posted On: 2011-30-01 . View Related Posts . . View 11 Replies .

Media - Move Ringtones From Internal To External Memory

Is there a way to transfer from internal memory the ringtones to external memory? I tried to day but it wouldnt let me either delete or move the default ringtones in the internal memory. I managed only to copy them to the external folder.

Posted On: 02-21-2010, 11:56 AM . View Related Posts . . View 3 Replies .

Motorola Droid - Not Recognized As An Internal External Command

I just rooted my droid using this guide, installed busybox then made a custom recovery. I know how to use the change directory properly cause i did it enough times doing those things, so i'm pretty sure it's not that.

http://androidforums.com/all-things-root-droid/45764-guide-s-everything-root-related.html

After that my command prompt stopped working for me when i wanted to start doing stuff. It gives me that error; "not recognized as an internal external command, operable program or batch file"
I'm not sure why it's not working for me, not a tech savy guy really, just know how to follow tutorials.
I'm thinking it may be my path variable needs to be fixed some how, but i don't know much else about it, so i haven't touched it.


Posted On: 02-25-2010, 11:47 PM . View Related Posts . . View 12 Replies .

Check Whether External Storage Available - Not / Write Files Or Pictures Into It

This is for the first time i am using external storage in android.
How can i perform different operations such as how to check whether external storage is available or not?, How to write files or pictures into storage.


Posted On: Aug 30 at 6:56 . View Related Posts . . View 1 Replies .

Services - Thread In Background That Makes Request To An External Api

I'm developing an android application. Actually, i have a thread in background that makes request to an external api in order to get data when the users clicks in different parts of the app. My doubt is if this "thread" would be better if i implemented it as a service instead of a runnable class.

Posted On: Feb 15 at 21:02 . View Related Posts . . View 3 Replies .

Htc Hero - Connect To A External Hard Drive Directly

Can you connect to a external hard drive directly. Was thinking it might be possible via the usb connection.

Posted On: 11-02-2009, 05:24 AM . View Related Posts . . View 5 Replies .

Part Of My Bitmap Image Missing When Written To External Storage / Why Is So

I want to send an image of a view to external storage so that it can be printed. The view is a grid made up of a tablelayout, tablerows and textviews. I write the view to the sdcard, then copy it to my hd using the ddms file-explorer screen. But when i look at it in ms paint, the image is only partially there.

I have tested this two ways.

When i used the xml version, the result was a small black square " no detail, no grid, nothing.

Next i created a textview programmatically, with text using settext(aaaŁ). The resulting bitmap had the correct color and size, but the text was missing.

Would someone please tell me how to get my view correctly written to external storage so that it looks like it does on the android screen? Code.


Posted On: Nov 10 at 7:00 . View Related Posts . . View 1 Replies .

Installing Apps, Games Files Into External Sd Card On Samsung Galaxy S2

I have a samsung galaxy s2 i9100g, along with sony xperia neo and htc desire z. After searching extensively throughout the internet and androidforums.com, i needed to post this thread.

On my xperia neo, which has no "internal storage" unlike the sgs2, apps/games can install completely on its "external sd storage". The same is applied to the desire z.

On the sgs2 however, the app/game is present on the "internal sd storage". (11gb out of 16gb). It only move 1% in reality to the "external sd" that too into the secandroid folder.

What i want to ask is that apps such as "sygic", "gta 3", "asphalt", "nova" etc have considerable size of files and while the sgs2 has 11gb available they install into the "internal sd" but in xperia neo, which has about 200mb of "internal phone memory" and no "internal sd storage", these apps/games install their bulk files into the "external sd storage" which is shown as "sd storage".

Please help me and tell me how i can makes these apps/games install their files into the "external sd card". Since "asphalt 6" is about 900mb and on sgs2 it is on the 11gb "internal sd" while on the xperia it is on the "external sd" which is mounted as the "sd card". I am waiting for your helpful replies and advises.


Posted On: February 17th 2012 . View Related Posts . . View 8 Replies .

User Comment: Anker Astro 5600mah External Battery For Galaxy Nexus

I carried stock battery to replace extended battery when it gets low, and got sick of removing case, then back cover each time. And those external batteries were kinda too big to carry until i found this one. 5600mah is almost good enough to recharge gnex battery 3 times, plus it has all kind of recharging tips so i could use it to recharge my bluetooth headset, fiio, and speaker. So i only need to recharge anker at home.

Posted On: January 19th 2012 . View Related Posts . . View 5 Replies .

Multiple Overlay Items

I seem to be having a problem with using itemizedoverlay and overalyitems in it.

I can get the first overlayitem to appear on the map but not any items after that.

Code sample is on: http://www.Anddev.org/multiple_overlay_items-t12171.html

Quick overview here:

Code:.

Samples of how it's used:

Code:.

The first marker shows up on the map but if i add any more they don't show up? Is there a problem with the populate() method? I tried calling it manually after adding all markers but it still didn't help.


Posted On: Mar 19 at 18:28 . View Related Posts . . View 4 Replies .

Multiple Browsers Installed

I've installed a number of browsers on my desire and am having a couple of issues. (The desire is unbranded with froyo and the browsers are opera mobile, firefox 4 beta and dolphin, plus the default. )

Flash only works in the default browser. Am i missing something that enables flash content in other browsers? Although flash has always worked in the default, i've installed flash 10. 1 from the market, but that made no difference, and i've also clicked through to install missing plugins for at least one of the additional browsers, which takes me to an adobe page saying flash is not available for my platform (go figure).

Every link i click on asks me which browser to use. Every time i click a link, i get a "complete action using" dialog, listing my browsers (normally minus opera, though occasionally the list differs). I can't seem to stop this and it's driving me nuts. It's as if the http request goes through the os rather than the browser itself, giving me the option every time. Telling it to always use the chosen app for the action has no effect, so either it's not remembering that or each request or url constitutes a different action (!).

Is my only option to uninstall other browsers? I'd rather not, since it's the only way i can see of having the option of browsing either mobile or standard versions of the same sites (generally i want the full versions, but some things, like the bbc iplayer's controls, are unusable in full mode). Ideally i want to have a second browser if for no other reason than using the iplayer in mobile mode, but that requires me to have flash running in it and for the sake of my sanity also requires me not to have to go through a dialog for every link/action i click on.


Posted On: 11-16-2010, 05:16 AM . View Related Posts . . View 4 Replies .

Connecting Multiple Phones

I am looking forward to developing an application which needs a cellphone to connect with about 20 cellphones in its vicinity (say about 50 metres) .

1. Which technology allows this ?

2. Does android support it?


Posted On: Aug 23 2009 . View Related Posts . . View 7 Replies .

Multiple Sliding Drawers

I am m currently trying to incorporate multiple sliding drawers into one of my views. Unfortunately i haven't been able to position them next to each other at the bottom of the screen. As default they handles will overlap each other in the order they have been attached to the parent view. One ugly workaround woud be to add the necessary margin by making the outer handle's graphics bigger (ie. Adding transparent space to the left or right) and attach them to the parent view in the right order. However this doesn't work for more than 2 drawers (i need 3 of them), as the transparent areas of the handle's still count as target when clicked on them.

Anyone know how i can position the handles of multiple drawer's handles, so that they don't overlap and be all clickable?


Posted On: Jul 29 . View Related Posts . . View 2 Replies .

Edittext With Multiple Listners

We have a few actions to be taken based on edit and based on focus lost on a text filed, hence we made sure this view object listens to both some thing like this fieldedit. Addtextchangedlistener(filelist); fieldedit. Setonfocuschangelistener(filelist);

In this context, when the field is edited and focus is lost i would expect text change events should be handled completely before onfocuschange events are executed provided the is only one event handling thread.could any one tell me if there is only one event handling thread. Also in this event handling code if we are adding and remove parts of the view what kind of deadlock could happen. For some reasons related to updates to view is resulting in dead lock some where and we are seeing error messages


Posted On: May 7 2009 . View Related Posts . . View 2 Replies .

How To Show Multiple Lines Of Text?

How do you use a text-view to show multiple lines of text in android? I tried doing android:singleline = "false" but that's not working

Here is my code

For(int i = 1; i <= 10; i+)
{
Tv. Settext("instant " + i + ": ");
}

So it should say

Instant 1:
Instant 2:
Instant 3:
Instant 4:
Instant 5:
Instant 6:
Instant 7:
Instant 8:
Instant 9:
Instant 10:

But, the emulator only showing

Instant 10:

How can i achieve this?


Posted On: 2010-11-15 . View Related Posts . . View 1 Replies .

Video With Multiple Audio Tracks

Forgive me if this has been asked before (a search brought nothing up) but i was wondering if anybody knew of a video playing app that supported multiple audio tracks (e.g.commentary, languages)? I have a couple of mp4s with 2 tracks but the second one is the only one that will play in act1, video player, etc.

Posted On: 11-25-2009, 08:54 PM . View Related Posts . . View 4 Replies .

How To Invalidate Multiple Parts Of Screen

I need to be able to selectively invalidate multiple (about 20) rectangles on the screen for performance reasons, so tried the following in my ondraw method code.

Posted On: May 20 . View Related Posts . . View 2 Replies .