felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clement Escoffier <clement.escoff...@gmail.com>
Subject Re: Felix on Android
Date Tue, 16 Feb 2010 18:26:20 GMT
Hi,



On 16.02.2010, at 19:20, pablomj wrote:

> 
> Hi everyone, I know what is my current problem.
> 
> the problem is in this try
> 
>    void launchFelix() 
>    {
>    	Log.d("Felix", "About to start Felix...");
>    	// Create a configuration property map
>    	String cacheDir = null;
>    	//String FELIX_CACHE_DIR =
> "/data/data/net.luminis.android.felix/cache";
>    	try {
> 			cacheDir = File.createTempFile("skifta", ".tmp").getParent();
> 		} catch (IOException e) {
> 			Log.d("Felix", "unable to create temp file", e);
> 			return;
> 		}
> .
> .
> .
> 
> Because I don't have permissions to write in the /sdcard directory of the
> emulator. So, the program can't create the temp file.
> 
> somebody knows how I can add permissions to this directory?
> Thanks.

Recent Android version have introduced a permission to write on the sdcard
Add this line to your manifest:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Moreover, check that you have created an AVD with an SDCARD. 

Regards,

Clement

> 
> 
> 
> 
> 
> clement escoffier wrote:
>> 
>> 
>> On 15.02.2010, at 18:56, pablomj wrote:
>> 
>>> 
>>> Hi everyone, here are my advances,
>>> 
>>> I reviewed all steps, I can instanciate a Felix object like in your
>>> example.
>>> It was a problem with dependencies. 
>>> 
>>> Proving for install for start and stop a bundle I made in the code:
>>> 
>>>           BundleContext newBundle = m_felix.getBundleContext();
>>>           bb.installBundle(pathOfTheBundle);
>>> 
>>> When...now my problem is this pathOfTheBundle, I tried put in
>>> pathOfTheBundle "/data/felix/EnglishDictionary.jar" (location where I put
>>> this bundle with adb push ..... in console )and some variants, but always
>>> is
>>> an wrong path. What I must express my bundle location?
>>> 
>>> Can anybody help me? Thanks again. 
>> 
>> Try with: file:/data/felix//EnglishDictionary.jar. 
>> 
>> Be also aware that this location is not available on regular devices. For
>> such kind of manipulation, you should use the external storage (generally
>> /sdcard, but use the Environment class to get the root). (you can also use
>> the internal application assets).
>> 
>> Regards,
>> 
>> Clement
>> 
>>> 
>>> Regards, Pablo.
>>> 
>>> 
>>> 
>>> 
>>> Jackson, Bruce wrote:
>>>> 
>>>> Yes, you can.
>>>> 
>>>> In the code I sent you, you'll see that you can get a handle to the
>>>> BundleContext for the framework itself. From this you can then call:
>>>> 
>>>> context.installBundle(String location);
>>>> 
>>>> to install your own bundles.
>>>> 
>>>> 
>>>> On 12/02/2010 15:07, "pablomj" <pablomj85@hotmail.es> wrote:
>>>> 
>>>>> 
>>>>> Oh, thanks Bruce and Karl for your comments.
>>>>> 
>>>>> I did something wrong, because I can't instanciate an "Felix" object.
>>>>> So,
>>>>> I
>>>>> am going to review all steps...
>>>>> 
>>>>> Although I don't see running this yet, I will can start and stop
>>>>> bundles
>>>>> from my Android application? I excited to view this!
>>>>> 
>>>>> Regards,
>>>>> Pablo.
>>>>> 
>>>>> 
>>>>> Karl Pauls wrote:
>>>>>> 
>>>>>> Why would you need 1.5 to be able to dex the bundle (the framework
>>>>>> itself is build for 1.3 btw.)?
>>>>>> 
>>>>>> regards,
>>>>>> 
>>>>>> Karl
>>>>>> 
>>>>>> On Fri, Feb 12, 2010 at 1:15 PM, Jackson, Bruce <brucej@qualcomm.com>
>>>>>> wrote:
>>>>>>> Hi Pablo
>>>>>>> 
>>>>>>> See the attached code. The biggest problem I've encountered is
that
>>>>>>> the
>>>>>>> Felix distribution is a huge pain to build under JDK 1.5, and
>>>>>>> therefore
>>>>>>> to
>>>>>>> be able to use some of the bundles (for example the http service)
>>>>>>> that
>>>>>>> are
>>>>>>> part of the distribution. Its not a simple job of just changing
a
>>>>>>> couple
>>>>>>> of
>>>>>>> entries in POM files: some components download pre-built JAR
files
>>>>>>> from
>>>>>>> the
>>>>>>> web and explode these, thereby having classes built under 1.4
which
>>>>>>> will
>>>>>>> not
>>>>>>> work when you dexify the bundles.
>>>>>>> 
>>>>>>> This is something that would be great to see some work done on
by the
>>>>>>> Felix
>>>>>>> community, because while its true that the basic Felix core does
and
>>>>>>> will
>>>>>>> support Android, most of the add-on bundles wont.
>>>>>>> 
>>>>>>> For my part, the ideal solution would be to see the whole framework
>>>>>>> be
>>>>>>> based
>>>>>>> on JDK 1.5 and not 1.4.
>>>>>>> 
>>>>>>> Thanks
>>>>>>> 
>>>>>>> Bruce
>>>>>>> 
>>>>>>> 
>>>>>>> On 12/02/2010 11:32, "pablomj" <pablomj85@hotmail.es> wrote:
>>>>>>> 
>>>>>>>> 
>>>>>>>> Hi Bruce, I am trying the same, but I don't have the solution
yet.
>>>>>>>> Do you have some advance?
>>>>>>>> Salutations, thanks.
>>>>>>>> Pablo.
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Jackson, Bruce wrote:
>>>>>>>>> 
>>>>>>>>> The Felix site has a useful section on getting things
going on
>>>>>>>>> Android
>>>>>>>>> (
>>>>>>>>> http://felix.apache.org/site/apache-felix-and-google-android.html)
>>>>>>>>> but
>>>>>>>>> isn't
>>>>>>>>> so clear about embedding the framework into an Android
app"
>>>>>>>>> 
>>>>>>>>> "Apache Felix can also be integrated with an Android
application.
>>>>>>>>> To
>>>>>>>>> achieve
>>>>>>>>> this, you need to embed Felix into onCreate() method
of your
>>>>>>>>> Activity
>>>>>>>>> class
>>>>>>>>> (see Android docs for more details on how to use an Activity)
and
>>>>>>>>> process
>>>>>>>>> your bundles as shown above."
>>>>>>>>> 
>>>>>>>>> Has anyone got an example of how you do this? I understand
how to
>>>>>>>>> write
>>>>>>>>> the
>>>>>>>>> Android app, and I get the point being made here. What
I need to
>>>>>>>>> understand
>>>>>>>>> is:
>>>>>>>>> 
>>>>>>>>> 1. How do you launch the Felix framework. What do I need
to
>>>>>>>>> instantiate?
>>>>>>>>> 2. Where does the framework get its boot configuration
(i.e. what
>>>>>>>>> bundles
>>>>>>>>> to
>>>>>>>>> load, run levels, environment variables, etc) from in
this case?
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> -- 
>>>>>> Karl Pauls
>>>>>> karlpauls@gmail.com
>>>>>> 
>>>>>> 
>>>> 
>>>> 
>>>> 
>>> 
>>> -- 
>>> View this message in context:
>>> http://old.nabble.com/Felix-on-Android-tp27245141p27597525.html
>>> Sent from the Apache Felix - Dev mailing list archive at Nabble.com.
>>> 
>> 
>> 
>> 
> 
> -- 
> View this message in context: http://old.nabble.com/Felix-on-Android-tp27245141p27612787.html
> Sent from the Apache Felix - Dev mailing list archive at Nabble.com.
> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message