[android-developers] How to use a brand in play store?

2016-11-14 Thread André Corrêa
How do I release my company logo for use in an app and play store? Is there 
a form, some contact channel?

Thanks!


-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/ef638205-1f1f-46c3-83ff-d443e0dcdabe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] App crashes when trying to open but no errors in the code

2016-09-15 Thread André Bertel
I'm fairly new to Java. And I've been playing around with webview during 
the last couple of days. But I've encountered a problem I can't seem to 
solve on my own.

This is the log:

http://pastebin.com/KVnp4aNt

And this is the activity that seems to cause the problem:

http://pastebin.com/NBx0Hjxg

Thank you in advance :)

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/710204eb-2f70-4054-92f1-2d1b7a70b8d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [android-developers] CallLog.Calls.DURATION value is not showing exact Active call duration it considers ringing time as well

2015-01-26 Thread André L
I notice the same and I am trying to find out a solution
Em 19/01/2015 07:25, "Aruna"  escreveu:

> Hello,
>
> I am trying to fetch the call duration from CallLog.Calls table, below 5.0
> (Lollipop) releases the call DURATION is considered only when the call is
> accepted by other party, but in the latest 5.0 release I noticed that the
> CallLog.Calls.DURATION column gets populated and shows non-zero value, it
> is considering Ringing time also as call duration.
>
> Is there any reason why duration includes ringing time as well where as
> duration should hold only active all duration time.
>
> Could you please provide details on this?
>
> Thanks,
> Aruna
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-developers+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Order latitude/longitude list by distance to my current location

2012-12-31 Thread Nelson André
Hello all,

I have a JSON list that I retrive from one website I have that gives me the 
following fields:


   - Name
   - Latitude
   - Longitude

This list has around 200 items.

I want to order the list by distance to my current location, closer 
locations on top.

How may I do this calculation and ordering?

Many Thanks

Nelson

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Speaker Problem

2012-12-19 Thread André Lima
SOLVED.

Reading the jelly bean code source, i've found this code

// This is not an error but might cause users' confusion. Add log just in 
case.
Log.i(LOG_TAG, "Forcing speaker off when initiating a new outgoing 
call...");
PhoneUtils.turnOnSpeaker(app, false, true);

So that's it, in version 4.1 android forces speaker off in incoming and 
outgoing calls.
My solution is turn on the speaker in my call state broadcast receiver, 
after start to make a call

On Tuesday, December 18, 2012 9:45:07 AM UTC-2, André Lima wrote:
>
> - I have the permission MODIFY_AUDIO_SETTINGS declared
> - I use the following code to make a call with speaker ON
>
> AudioManager am = null;
>
> am = (AudioManager)getSystemService(Context.AUDIO_SERVICE);  
>
> am.setMode(AudioManager.MODE_IN_CALL); 
>
> am.setSpeakerphoneOn(true);
>
> The problem is: This works fine in version 4.0 and lower.
> Version 4.1 and higher doesn't works, but I don't receive errors. Just 
> doesn't work.
>
> Does anyone can help me with ideas?
>
> Best Regards,
> André
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Speaker Problem

2012-12-18 Thread André Lima
- I have the permission MODIFY_AUDIO_SETTINGS declared
- I use the following code to make a call with speaker ON

AudioManager am = null;

am = (AudioManager)getSystemService(Context.AUDIO_SERVICE);  

am.setMode(AudioManager.MODE_IN_CALL); 

am.setSpeakerphoneOn(true);

The problem is: This works fine in version 4.0 and lower.
Version 4.1 and higher doesn't works, but I don't receive errors. Just 
doesn't work.

Does anyone can help me with ideas?

Best Regards,
André


-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

RES: [android-developers] When can every developer reply to reviews?

2012-11-30 Thread ## André ##
This is a Good Question!

 

I’ve put my email address in app description, asking users tell me about
suggests, problems, bugs, by mail.

 

However they insist in comment. 

 

The same is happening with a specific user which receive error sometimes

 

I am almost puting my cellphone number in the description J

 

Regards,

André

 

 

De: android-developers@googlegroups.com
[mailto:android-developers@googlegroups.com] Em nome de Francisco Marzoa
Enviada em: sexta-feira, 30 de novembro de 2012 08:30
Para: android-developers@googlegroups.com
Assunto: Re: [android-developers] When can every developer reply to reviews?

 

Spot on!

On Nov 30, 2012 7:34 AM, "Techni"  wrote:

I am getting some really STUPID comments and it's infuriating that I can do
nothing about them

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
<mailto:android-developers%2bunsubscr...@googlegroups.com> 
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Android magnetometer sampling rate improvement/jitter reduction

2012-09-29 Thread André Costa Lima
I'd like to ask for some help regarding the sampling rate and jitter on the 
magnetometer. I'm working on a project with some people that involves a 
high rate magnetic field sampling application. Even though we have 
developed an algorithm to workaround the jitter and other issues we 
encountered, we'd like to improve the sampling rating somehow and, at the 
same time, if possible, attempt to reduce the sampling jitter which is 
worse than sampling at a lower rate. We are using a Samsung Nexus S and 
according to the tests we performed we observed that the sampling rates 
between 15ms and 20ms and, sometimes, peaks around 50 ms (this is between 
consecutive events). 

People that are more experienced with Android than us, might have a 
possible hint on how to address these issues. Even though we came up with 
different ideas for different approaches, we are not quite sure where the 
bottleneck could lie, besides the intrinsic sensor hardware constraints 
(AK8973 magnetometer).

Our approaches are:

   1. Modify the sensor device driver
   2. Use Android NDK to develop native code in order to obtain the samples 
   from the sensor (already tested - the results were the same as the ones 
   obtained at the Java level)
   3. Modify the Android API, that is, improve somehow how the events are 
   handled
   4. Root the phone and deactive unnecessary tasks running in the 
   background
   5. Attempt to modify at the kernel level the interrupts priorities

I just wanted to ask for some hints/directions on how to address these 
issues, that is, what could be the best approach based on your experience 
and knowledge of Android and according to the location of the bottleneck.

Thank you in advance for your attention.

(I'm sorry for my english as I'm not a native speaker)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Help with first application

2012-09-05 Thread Nelson André
Hello all,

I'm building my first application.

I have a website that returns me a JSON list with name and lat/long 
coordinates of some locations.

How can I show that list on screen with a column with the distance from my 
current location to each of the locations, ordered by closest on top?

Thanks in advance!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Get the address from sms thread

2012-08-08 Thread ## André ##
This is my problem: I update all the sms address number, however i couldn't
update the number which is showed on sms inbox. 
Example: I updated the sms address to 555- however in the sms inbox
still shows 555-. If I enter in the thread the address number is correct
and updated

I am using content://sms/

Anyone can help me?
Please tell me if i am not so clear

Best Regards,
André

 

 

 

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] .Net Web Service keeps receiving null parameters from Android application using ksoap2

2012-07-22 Thread Jacques André Labuschagne
I have a .Net Web Service running on IIS v6 on a Windows XP 64 laptop 
connected to a wifi network at home called intellinet. Now the .Net WS is 
running on the laptop with the ip address 192.168.2.103. The laptop is also 
running an SQL Server 2008 sp3 by means where the WS can communicate with 
it. 

SQL Server 2008 sp3 is can be run with sa account login.

The following is the asmx file on the WS
===

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.Collections;



namespace TaxiMoveWebService
{
/// 
/// Summary description for Service1
/// 
[WebService(Namespace = "bata.co.za/", Name = "TaxiMoveWebservice", 
Description = "Webservice for TaxiMove Application")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET 
AJAX, uncomment the following line. 
// [System.Web.Script.Services.ScriptService]
public class Service1 : System.Web.Services.WebService
{

[WebMethod]
public string HelloWorld()
{
return "Hello World";
}

[WebMethod]
public string CheckMarhsalLogin(string LoginUsername, string 
LoginPassword)
{
string output = "";
try 
{
using (SqlConnection myConnection = new 
SqlConnection(@"Data Source= JAKES-LAPTOP;Initial Catalog=TaxiMoveV2;User 
ID=sa;Password=garrison")) 
{ 
myConnection.Open();
using (SqlCommand myCommand = new SqlCommand()) 
{ 
myCommand.Connection = myConnection; 
myCommand.CommandText = "SELECT * FROM 
Employee WHERE LoginUsername = @Username AND LoginPassword = @Password";
myCommand.Parameters.Add("@UserName", 
SqlDbType.NVarChar, 50).Value = LoginUsername; 
myCommand.Parameters.Add("@Password", 
SqlDbType.NVarChar, 50).Value = LoginPassword; 


if(int.Parse(myCommand.ExecuteScalar().ToString()) == 1)
{
output = "success";
}
else
{
output = "bad username or password";
}

} 
}
 }
catch (Exception ex) 
{ 
 output = "an error occurred." + ex.ToString(); 
}
return output;
}//end of webmethod
}
}


and my java code is this on a class called DataAccessLayer.java
=
package com.jstsolutions.android.taximove;

import org.ksoap2.SoapEnvelope; 
import org.ksoap2.serialization.PropertyInfo; 
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;

import android.app.AlertDialog;

public class DataAccessLayer {

public  final String WSDL_TARGET_NAMESPACE = "bata.co.za/";
public  final String SOAP_ADDRESS = 
"http://192.168.2.103/TaxiMoveWebService/TaxiMove.asmx";;
 public final String spa_HalloWorld = "bata.co.za/HelloWorld";
 public final String opn_HelloWorldResult = "HelloWorldResult"; 
 public final String spa_ReturnMarshal = "bata.co.za/CheckMarhsalLogin";
public final String opn_CheckMarhsalLoginResult = "CheckMarhsalLoginResult";
 public String ReturnHalloWorld()
{
SoapObject request = new 
SoapObject(WSDL_TARGET_NAMESPACE,opn_HelloWorldResult);


SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.dotNet = true;

envelope.setOutputSoapObject(request);

HttpTransportSE httpTransport = new HttpTransportSE(SOAP_ADDRESS);
Object response=null;
try
{
httpTransport.call(spa_HalloWorld, envelope);
response = envelope.getResponse();
}
catch (Exception exception)
{
response=exception.toString();
}
return response.toString();
}
 public String ValidMarshalLogin(String EnteredUsername, String 
EnteredPassword)
{
   SoapObject request = new 
SoapObject(WSDL_TARGET_NAMESPACE,opn_CheckMarhsalLoginResult);
//SoapObject parameters = new 
SoapObject(WSDL_TARGET_NAMESPACE,opn_CheckMarhsalLoginResult);
request.addProperty("LoginUsername",EnteredUsername.toString());
request.addProperty("LoginPassword",EnteredPassword.toString());
 //request.addProperty(opn_CheckMarhsalLoginResult,parameters);
SoapSerializationEnvelope envelope = new SoapSe

[android-developers] Someone use GridLayout (ADT-17) in v7?

2012-03-23 Thread André Luiz R . Silva
Someone use GridLayout  (ADT-17) in v7?

Errors:
[GridLayoutTest] ERROR: In  GridLayout_Layout, unable to
find attribute android:layout_marginEnd
[GridLayoutTest] ERROR: In  GridLayout_Layout, unable to
find attribute android:layout_marginStart

Use /extras/android/support/v7/gridlayout.

-- 
*Atenciosamente,

André Luiz R. Silva
@andreronsilva*

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Help/collaboration needed from Dianne or someone at the Android team in explaining some results on a mobile computing project/article on time-shifted location

2011-12-23 Thread André Coelho
Hello. I'm an MSc student at University of Minho, Portugal and I'm
currently involved in a *Mobile Computing project* in which we use
+Android to facilitate conducting *user experience studies* and
gathering various data. We devised a method for gathering *location
information*, powered by Android and Google APIs. We did this because
we needed to be able to gather location data with little hassle and
cost to the users (*no data connection, no gps, minor battery life
impact*).

We tested the method against the location obtained in real-time by the
device and ground truth and, we obtained good results but we are
having some issues explaining why some of the results were so much
better.

The Professors co-authoring the article and I thought it would be a
good idea to reach out to you and see if you could possibly help us
explain the results, given *your knowledge of the inner workings of
Android*. Maybe you would even be interested in co-authoring the
article as well. Or perhaps you could direct me to someone within the
Android team that would be interested in collaborating. The article
can be read at our University's repository:
http://repositorium.sdum.uminho.pt/bitstream/1822/15641/1/123_Poster.pdf

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Android Development Environment?

2011-11-14 Thread André Cipriani Bandarra
+1 for Eclipse + Linux

On Mon, Nov 14, 2011 at 2:11 PM, Latimerius wrote:

> On Fri, Nov 11, 2011 at 10:56 PM, Jones  wrote:
> > What development environments are most Android developers using
> > (Eclipse, IntelliJ, etc)?
> >
> > What development platform is most prevalent (Windows, OSX, Linux)?
>
> No idea as to what _most_ developers are doing but I use Eclipse/Linux.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Change default debug key?

2011-11-10 Thread André
Thank you Kostya,
that worked perfectly!

On Nov 10, 2:02 pm, Kostya Vasilyev  wrote:
> Try setting android:debuggable="true" in the manifest, it's switched off
> for release builds (such as when you export an APK).
>
> Then sign, install with "adb install", upload to Market.
>
> To debug, use DDMS to attach to the already running process.
>
> -- Kostya
>
> 10.11.2011 16:42, André пишет:
>
>
>
>
>
>
>
>
>
> > Thanks Francisco,
> > I tried but it doesn't accept my keystore. After reading:
> >http://developer.android.com/guide/publishing/app-signing.htmlSigning
> > in debug mode. It says:
>
> > "If necessary, you can change the location/name of the debug keystore/
> > key or supply a custom debug keystore/key to use. However, any custom
> > debug keystore/key must use the same keystore/key names and passwords
> > as the default debug key (as described above). (To do so in Eclipse/
> > ADT, go to Windows>  Preferences>  Android>  Build.)
>
> > Caution: You cannot release your application to the public when signed
> > with the debug certificate."
>
> > If I understand this correctly it means that I can't sign it for
> > debugging with my private key and if I can't do that I can't debug
> > since it's not possible to upload an apk signed with the debug key.
> > Any suggestions?
>
> > //André
>
> > On Nov 10, 11:46 am, Francisco Dalla Rosa soares
> > wrote:
> >> Go to the Eclipse Settings (not the project one),
> >> there you go to the "Build" tab under "Android".
> >> You should see a "Default debug keystore" option
> >> and a custom debug keystore option.
>
> >> 2011/11/10 André
>
> >>> I'm trying to debug my app with in-app billing. But when I upload an
> >>> apk to the market to test it I obviously need to sign the apk with my
> >>> private key but then the keys don't match when I want to use the debug
> >>> mode in eclipse. And If I install my exported apk I can't get eclipse
> >>> to run the apk for testing on my phone.
> >>> So is it possible to change the default android debug key to my own
> >>> private or is there another approach?
> >>> //André
> >>> --
> >>> You received this message because you are subscribed to the Google
> >>> Groups "Android Developers" group.
> >>> To post to this group, send email to android-developers@googlegroups.com
> >>> To unsubscribe from this group, send email to
> >>> android-developers+unsubscr...@googlegroups.com
> >>> For more options, visit this group at
> >>>http://groups.google.com/group/android-developers?hl=en
> >> --
> >> 株式会社アルゴ ARGO Inc.
> >> 〒130-0012
> >> 東京都墨田区太平3-11-10
> >> NTKオオノビル8階
>
> >> ソアレス フランシスコ ( Soares Francisco )
> >> Mail : soa...@argo.bz HP :http://www.argo.bz/
> >> TEL:03-5619-4511 FAX:03-5619-4512
>
> --
> Kostya Vasilyev

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Change default debug key?

2011-11-10 Thread André
Thanks Francisco,
I tried but it doesn't accept my keystore. After reading:
http://developer.android.com/guide/publishing/app-signing.html Signing
in debug mode. It says:

"If necessary, you can change the location/name of the debug keystore/
key or supply a custom debug keystore/key to use. However, any custom
debug keystore/key must use the same keystore/key names and passwords
as the default debug key (as described above). (To do so in Eclipse/
ADT, go to Windows > Preferences > Android > Build.)

Caution: You cannot release your application to the public when signed
with the debug certificate."

If I understand this correctly it means that I can't sign it for
debugging with my private key and if I can't do that I can't debug
since it's not possible to upload an apk signed with the debug key.
Any suggestions?

//André

On Nov 10, 11:46 am, Francisco Dalla Rosa soares 
wrote:
> Go to the Eclipse Settings (not the project one),
> there you go to the "Build" tab under "Android".
> You should see a "Default debug keystore" option
> and a custom debug keystore option.
>
> 2011/11/10 André 
>
>
>
>
>
>
>
>
>
> > I'm trying to debug my app with in-app billing. But when I upload an
> > apk to the market to test it I obviously need to sign the apk with my
> > private key but then the keys don't match when I want to use the debug
> > mode in eclipse. And If I install my exported apk I can't get eclipse
> > to run the apk for testing on my phone.
>
> > So is it possible to change the default android debug key to my own
> > private or is there another approach?
>
> > //André
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> 株式会社アルゴ ARGO Inc.
> 〒130-0012
> 東京都墨田区太平3-11-10
> NTKオオノビル8階
>
> ソアレス フランシスコ ( Soares Francisco )
> Mail : soa...@argo.bz HP :http://www.argo.bz/
> TEL:03-5619-4511 FAX:03-5619-4512

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Change default debug key?

2011-11-10 Thread André
I'm trying to debug my app with in-app billing. But when I upload an
apk to the market to test it I obviously need to sign the apk with my
private key but then the keys don't match when I want to use the debug
mode in eclipse. And If I install my exported apk I can't get eclipse
to run the apk for testing on my phone.

So is it possible to change the default android debug key to my own
private or is there another approach?

//André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Proguard problem

2011-11-06 Thread André
I have  a problem when I'm trying to export my project in eclipse.
While trying to create the apk gives me this error.
What could cause this?

[2011-11-06 17:29:50 - Project- X] Proguard returned with error code
1. See console
[2011-11-06 17:29:50 - Project- X] java.io.FileNotFoundException: C:
\android\tools\proguard\bin\X\proguard\dump.txt (The system cannot
find the path specified)
[2011-11-06 17:29:50 - Project- X]  at
java.io.FileInputStream.open(Native Method)
[2011-11-06 17:29:50 - Project- X]  at
java.io.FileInputStream.(Unknown Source)
[2011-11-06 17:29:50 - Project- X]  at
java.io.FileReader.(Unknown Source)
[2011-11-06 17:29:50 - Project- X]  at
proguard.FileWordReader.(FileWordReader.java:46)
[2011-11-06 17:29:50 - Project- X]  at
proguard.ConfigurationParser.parseIncludeArgument(ConfigurationParser.java:
196)
[2011-11-06 17:29:50 - Project- X]  at
proguard.ConfigurationParser.parse(ConfigurationParser.java:105)
[2011-11-06 17:29:50 - Project- X]  at
proguard.ProGuard.main(ProGuard.java:491)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Google Analytics SDK?

2011-11-01 Thread André Cipriani Bandarra
+1 for Flurry :D

On Tue, Nov 1, 2011 at 11:24 AM, Oli Wright  wrote:

> +1 for Flurry.  The device and carrier info is interesting (I won't commit
> to useful as I couldn't back that up with much conviction ;) ).
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: get first row from cursor

2011-10-28 Thread André
Thanks both of you. It worked!

On Oct 28, 5:35 pm, Kostya Vasilyev  wrote:
> 28.10.2011 19:12, André пишет:
>
> > cursor.moveToFirst();
> > while (cursor.moveToNext()) {
> > ...}
>
> > When I use this code the first row in my cursor seems to be skipped.
>
> Of course - the code moves to first row, then moves to next row, then
> does "..."
>
> > It feels wrong to make the cursor jump back one step in while every
> > time.
> > How would I get the first row ?
>
> cursor.moveToFirst, then do "..."
>
> or cursor.moveToNext() once, then do "..."
>
>
>
> > //André
>
> --
> Kostya Vasilyev

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] get first row from cursor

2011-10-28 Thread André
cursor.moveToFirst();
while (cursor.moveToNext()) {
...}

When I use this code the first row in my cursor seems to be skipped.
It feels wrong to make the cursor jump back one step in while every
time.
How would I get the first row ?

//André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] image (slide)show without images sliding, just changing

2011-10-24 Thread André
  this.finish();
break;
case R.id.button23:
//RESTART Button
cursor.moveToFirst();
i = 0;
if 
(cursor.getString(cursor.getColumnIndexOrThrow(DBase._photo)) !=
null){

setImage(cursor.getString(cursor.getColumnIndexOrThrow(DBase._photo)));

setTitle(cursor.getString(cursor.getColumnIndexOrThrow(DBase._date)),cursor.getString(cursor.getColumnIndexOrThrow(DBase._text)));
if (cursor.moveToNext()) theShow(theSpeed);
}
break;
case R.id.button24:
//SHOW PREVIOUS IMAGE + PAUSE
if (cursor.moveToPrevious()) {
if 
(cursor.getString(cursor.getColumnIndexOrThrow(DBase._photo)) !
= null){

setImage(cursor.getString(cursor.getColumnIndexOrThrow(DBase._photo)));

setTitle(cursor.getString(cursor.getColumnIndexOrThrow(DBase._date)),cursor.getString(cursor.getColumnIndexOrThrow(DBase._text)));
if (isPlaying) {
show.cancel();
isPlaying = false;

play.setText(getText(R.string.play).toString());
}
}
}
break;
}

}

@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean
fromUser) {
if (progress == 0 ) theSpeed = 2000;
if (progress == 1 ) theSpeed = 1500;
if (progress == 2 ) theSpeed = 1200;
if (progress == 3 ) theSpeed = 900;
if (progress == 4 ) theSpeed = 600;
if (progress == 5 ) theSpeed = 300;
theShow(theSpeed);
}

@Override
public void onStartTrackingTouch(SeekBar seekBar) { }

@Override
public void onStopTrackingTouch(SeekBar seekBar) { }

@Override
public void onDestroy() {
super.onDestroy();
cursor.close();
    db.close();
}

//André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Android game programming

2011-10-15 Thread André Cipriani Bandarra
I would recommento those on this blogpost:
http://www.codemansion.com/2011/10/books-on-java-game-programming.html

Although they're not android game programming books, they cover game
programming in java. Most of the stuff you learn and code can be easily
ported to Android...


André
2011/10/13 Jordi Puigdellívol Hernández 

> You can try andengine, it has some samples that may help you
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Best way to send data between devices?

2011-10-07 Thread André
Thanks, this was exactly what i needed!


On Oct 7, 10:09 am, shaman virk  wrote:
> make a server , if a device 'A' wants to send data to other device'B', 'A'
> will send data to server and server will send data to 'B'
>
> use Cloud To Device Messaging "C2DM" technique for push notification from
> server to 'B'

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Best way to send data between devices?

2011-10-07 Thread André
I'm wondering if anyone can point me in a good direction to send data
from my app on one device to my app in another device the best way?
Was thinking about making the app connect to a online database and
have it constantly check for updates. Would this be the best way?

//André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Android: failed to setLocale() when constructing, closing the database

2011-10-04 Thread André
Found it! I asked for a saved preference which hadn't been loaded yet!

Thanks a lot for your time and help Kostya!

On Oct 4, 4:46 pm, Kostya Vasilyev  wrote:
> The exception comes later:
>
> package.Tabs.checkListName(DbAdapter.java:310
>
>
>
> > ... calls db.query() passing a null value in the list of query arguments
> > (the new String[] { ... arg1, arg2 ... } part).
>
> -- Kostya
>
> 2011/10/4 André 
>
>
>
>
>
>
>
> > I still can't figure it out!
>
> > This is what I use in my main activity to open the db.
>
> > @Override
> >        public void onCreate(Bundle savedInstanceState) {
> >                super.onCreate(savedInstanceState);
> >                setContentView(R.layout.main);
>
> >                db = new DbAdapter open(this);
> >                db.open();
>
> > Which calls:
>
> >    public DbAdapter open() throws SQLException {
> >        mDbHelper = new DatabaseHelper(mCtx);
> >        mDb = mDbHelper.getReadableDatabase();
> >        return this;
> >    }
>
> > Any ideas of how it could skip this step?
>
> > On Oct 4, 4:12 pm, Kostya Vasilyev  wrote:
> > > According to stack trace, your code gets past opening the database.
>
> > > And then:
>
> > > package.Tabs.checkListName(DbAdapter.java:310
>
> > > ... calls db.query() passing a null value in the list of query arguments
> > > (the new String[] { ... arg1, arg2 ... } part).
>
> > > This is not allowed, and causes the exception inside Andorid's database
> > > classes.
>
> > > -- Kostya
>
> > > 04.10.2011 17:40, André пишет:
>
> > > > 15:02:28.791: ERROR/AndroidRuntime(8904): Caused by:
> > > > java.lang.IllegalArgumentException: the bind value at index 1 is null
>
> > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
> > > > android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:
> > > > 237)
>
> > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
> > > > android.database.sqlite.SQLiteQuery.bindString(SQLiteQuery.java:185)
>
> > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
>
> > android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDr
> > iver.java:
> > > > 59)
>
> > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
>
> > android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.j
> > ava:
> > > > 1438)
>
> > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
>
> > android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java
> > :
> > > > 1317)
>
> > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
> > > > android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1271)
>
> > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
> > > > android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1391)
>
> > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
> > > > package.Tabs.checkListName(DbAdapter.java:310)
>
> > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
> > > > package.Main.getListId(Main.java:567)
>
> > > > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
> > > > package.Main.fillItems(Main.java:191)
>
> > > --
> > > Kostya Vasilyev
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Android: failed to setLocale() when constructing, closing the database

2011-10-04 Thread André
I still can't figure it out!

This is what I use in my main activity to open the db.

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

db = new DbAdapter open(this);
db.open();

Which calls:

public DbAdapter open() throws SQLException {
mDbHelper = new DatabaseHelper(mCtx);
mDb = mDbHelper.getReadableDatabase();
return this;
}

Any ideas of how it could skip this step?



On Oct 4, 4:12 pm, Kostya Vasilyev  wrote:
> According to stack trace, your code gets past opening the database.
>
> And then:
>
> package.Tabs.checkListName(DbAdapter.java:310
>
> ... calls db.query() passing a null value in the list of query arguments
> (the new String[] { ... arg1, arg2 ... } part).
>
> This is not allowed, and causes the exception inside Andorid's database
> classes.
>
> -- Kostya
>
> 04.10.2011 17:40, André пишет:
>
>
>
>
>
>
>
>
>
> > 15:02:28.791: ERROR/AndroidRuntime(8904): Caused by:
> > java.lang.IllegalArgumentException: the bind value at index 1 is null
>
> > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
> > android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:
> > 237)
>
> > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
> > android.database.sqlite.SQLiteQuery.bindString(SQLiteQuery.java:185)
>
> > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
> > android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDr 
> > iver.java:
> > 59)
>
> > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
> > android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.j 
> > ava:
> > 1438)
>
> > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
> > android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java 
> > :
> > 1317)
>
> > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
> > android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1271)
>
> > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
> > android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1391)
>
> > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
> > package.Tabs.checkListName(DbAdapter.java:310)
>
> > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
> > package.Main.getListId(Main.java:567)
>
> > 10-04 15:02:28.791: ERROR/AndroidRuntime(8904):     at
> > package.Main.fillItems(Main.java:191)
>
> --
> Kostya Vasilyev

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Android: failed to setLocale() when constructing, closing the database

2011-10-04 Thread André
10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
android.app.LocalActivityManager.startActivity(LocalActivityManager.java:
339)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
android.widget.TabHost
$IntentContentStrategy.getContentView(TabHost.java:656)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
android.widget.TabHost.setCurrentTab(TabHost.java:326)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
android.widget.TabHost.addTab(TabHost.java:216)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
package.Tabs.onCreate(Tabs.java:65)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1093)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1780)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): ... 11 more
10-04

15:02:28.791: ERROR/AndroidRuntime(8904): Caused by:
java.lang.IllegalArgumentException: the bind value at index 1 is null

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:
237)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
android.database.sqlite.SQLiteQuery.bindString(SQLiteQuery.java:185)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:
59)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:
1438)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:
1317)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1271)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1391)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
package.Tabs.checkListName(DbAdapter.java:310)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
package.Main.getListId(Main.java:567)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
package.Main.fillItems(Main.java:191)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
package.Main.toggleCheckAll(Main.java:322)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
package.Main.onCreate(Main.java:79)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1093)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1780)

10-04 15:02:28.791: ERROR/AndroidRuntime(8904): ... 20 more

Thanks

//André


On Oct 4, 3:17 pm, Kostya Vasilyev  wrote:
> The output looks good.
>
> If you're still getting the errors, post logcat output(s) with stack traces.
>
> 04.10.2011 17:08, André пишет:
>
> > I never had the version set to 0 so it should be onCreate.
>
> > I put a log like this for each db.executeSql: Log.w(TAG, "Starting to
> > create db!");
>
> > And got this output. Did I misunderstand you of how to find the
> > problem?
>
> --
> Kostya Vasilyev

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Android: failed to setLocale() when constructing, closing the database

2011-10-04 Thread André
I never had the version set to 0 so it should be onCreate.

I put a log like this for each db.executeSql: Log.w(TAG, "Starting to
create db!");

And got this output. Did I misunderstand you of how to find the
problem?

10-04 15:01:12.546: Warn/DbAdapter(8904): Starting to create db!
10-04 15:01:12.546: Warn/DbAdapter(8904): tabel1 created!
10-04 15:01:12.546: Warn/DbAdapter(8904): tabel2 created!
10-04 15:01:12.546: Warn/DbAdapter(8904): tabel3 created!
10-04 15:01:12.556: Warn/DbAdapter(8904): tabel4 created!
10-04 15:01:12.556: Warn/DbAdapter(8904): tabel5 created!
10-04 15:01:12.556: Warn/DbAdapter(8904): tabel6 created!
10-04 15:01:12.556: Warn/DbAdapter(8904): tabel7 created!
10-04 15:01:12.556: Warn/DbAdapter(8904): tabel8 created!
10-04 15:01:12.556: Warn/DbAdapter(8904): tabel9 created!
10-04 15:01:12.567: Warn/DbAdapter(8904): tabel10 created!
10-04 15:01:12.567: Warn/DbAdapter(8904): tabel11 created!
10-04 15:01:12.567: Warn/DbAdapter(8904): tabel12 created!

//André


On Oct 4, 2:49 pm, Kostya Vasilyev  wrote:
> 04.10.2011 16:42, André пишет:
>
> > I had a problem where the database called onCreate every time i
> > started my app and got the suggestion of using that bit of code. But I
> > see your point.
>
> I can see how that could happen if your VERSION was defined as 0, or if
> your onCreate failed.
>
> > Could that have anything to do with failt to setLocale?
>
> Possibly :)
>
>
>
> > I tried without that bit of code now and get this error:
> > the bind value at index 1 is null
>
> Ah, and so it does.
>
> Your code never completes creating the database. Fix onCreate to run
> start to finish without throwing an exception (add log statements on
> entry and exit to check, to step through in the debugger), and I think
> you won't see it called multiple times anymore.
>
> --
> Kostya Vasilyev

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Android: failed to setLocale() when constructing, closing the database

2011-10-04 Thread André
I had a problem where the database called onCreate every time i
started my app and got the suggestion of using that bit of code. But I
see your point.
Could that have anything to do with failt to setLocale?

I tried without that bit of code now and get this error:
the bind value at index 1 is null


On Oct 4, 2:31 pm, Kostya Vasilyev  wrote:
> Why do you have checkDataBase() in onCreate?
>
> SqliteOpenHelper already takes care of calling onCreate only when the db
> needs to initialized, onUpgrade when it needs to be upgraded (based on
> version numbers), or just to open and run with it.
>
> Hardcoding the DB path is a bad idea - you will run into devices where the
> path is different (e.g. the Galaxy S comes to mind).
>
> -- Kostya
>
> 2011/10/4 André 
>
>
>
>
>
>
>
> > I'm trying to create a database with 12 different tables which has
> > been working fine until today. Now every time I start my app for the
> > first time after uninstalling it and re-installing it (or just clear
> > app data) I get the error message seen in the title. However, the
> > second time I start the app after getting this error it works fine.
> > The code bellow is from my DatabaseHelper class which is more or less
> > the same as the android notepad tutorial.
>
> > This error comes after the database has been opened in my activity and
> > I try to make my first query.
>
> > Any suggestions of what could cause this and how to solve it?
>
> > private static class DatabaseHelper extends SQLiteOpenHelper {
>
> >    private static String DB_PATH = "/data/data/my_app/databases/";
>
> >    DatabaseHelper(Context context) {
> >        super(context, DATABASE_NAME, null, DATABASE_VERSION);
> >    }
>
> >    @Override
> >    public void onCreate(SQLiteDatabase db) {
> >        if (!checkDataBase()) {
> >            db.execSQL(TABLE_1);
> >            db.execSQL(TABLE_2);
> >            db.execSQL(TABLE_3);
>
> >            db.execSQL(TABLE_4);
> >            db.execSQL(TABLE_5);
> >            db.execSQL(TABLE_6);
>
> >            db.execSQL(TABLE_7);
> >            db.execSQL(TABLE_8);
> >            db.execSQL(TABLE_9);
>
> >            db.execSQL(TABLE_10);
> >            db.execSQL(TABLE_11);
> >            db.execSQL(TABLE_12);
> >        }
> >    }
>
> >    @Override
> >    public void onUpgrade(SQLiteDatabase db, int oldVersion, int
> > newVersion) {
> >        Log.w(TAG, "Upgrading database from version " + oldVersion + "
> > to " + newVersion + ", which will destroy all old data");
> >        db.execSQL("DROP TABLE IF EXISTS " + TABLE_1);
> >        db.execSQL("DROP TABLE IF EXISTS " + TABLE_2);
> >        db.execSQL("DROP TABLE IF EXISTS " + TABLE_3);
>
> >        db.execSQL("DROP TABLE IF EXISTS " + TABLE_4);
> >        db.execSQL("DROP TABLE IF EXISTS " + TABLE_5);
> >        db.execSQL("DROP TABLE IF EXISTS " + TABLE_6);
>
> >        db.execSQL("DROP TABLE IF EXISTS " + TABLE_7);
> >        db.execSQL("DROP TABLE IF EXISTS " + TABLE_8);
> >        db.execSQL("DROP TABLE IF EXISTS " + TABLE_9);
>
> >        db.execSQL("DROP TABLE IF EXISTS " + TABLE_10);
> >        db.execSQL("DROP TABLE IF EXISTS " + TABLE_11);
> >        db.execSQL("DROP TABLE IF EXISTS " + TABLE_12);
> >        onCreate(db);
> >    }
>
> >    private boolean checkDataBase() {
> >        SQLiteDatabase checkDB = null;
> >        try {
> >            checkDB = SQLiteDatabase.openDatabase(DB_PATH +
> > DATABASE_NAME, null, SQLiteDatabase.OPEN_READONLY);
> >            checkDB.close();
> >        } catch (SQLiteException e) {
>
> >        }
> >        return checkDB != null ? true : false;
> >    }
> > }
>
> > //André
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Android: failed to setLocale() when constructing, closing the database

2011-10-04 Thread André
I'm trying to create a database with 12 different tables which has
been working fine until today. Now every time I start my app for the
first time after uninstalling it and re-installing it (or just clear
app data) I get the error message seen in the title. However, the
second time I start the app after getting this error it works fine.
The code bellow is from my DatabaseHelper class which is more or less
the same as the android notepad tutorial.

This error comes after the database has been opened in my activity and
I try to make my first query.

Any suggestions of what could cause this and how to solve it?

private static class DatabaseHelper extends SQLiteOpenHelper {

private static String DB_PATH = "/data/data/my_app/databases/";

DatabaseHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}

@Override
public void onCreate(SQLiteDatabase db) {
if (!checkDataBase()) {
db.execSQL(TABLE_1);
db.execSQL(TABLE_2);
db.execSQL(TABLE_3);

db.execSQL(TABLE_4);
db.execSQL(TABLE_5);
db.execSQL(TABLE_6);

db.execSQL(TABLE_7);
db.execSQL(TABLE_8);
db.execSQL(TABLE_9);

db.execSQL(TABLE_10);
db.execSQL(TABLE_11);
db.execSQL(TABLE_12);
}
}

@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int
newVersion) {
Log.w(TAG, "Upgrading database from version " + oldVersion + "
to " + newVersion + ", which will destroy all old data");
db.execSQL("DROP TABLE IF EXISTS " + TABLE_1);
db.execSQL("DROP TABLE IF EXISTS " + TABLE_2);
db.execSQL("DROP TABLE IF EXISTS " + TABLE_3);

db.execSQL("DROP TABLE IF EXISTS " + TABLE_4);
db.execSQL("DROP TABLE IF EXISTS " + TABLE_5);
db.execSQL("DROP TABLE IF EXISTS " + TABLE_6);

db.execSQL("DROP TABLE IF EXISTS " + TABLE_7);
db.execSQL("DROP TABLE IF EXISTS " + TABLE_8);
db.execSQL("DROP TABLE IF EXISTS " + TABLE_9);

db.execSQL("DROP TABLE IF EXISTS " + TABLE_10);
db.execSQL("DROP TABLE IF EXISTS " + TABLE_11);
db.execSQL("DROP TABLE IF EXISTS " + TABLE_12);
onCreate(db);
}

private boolean checkDataBase() {
SQLiteDatabase checkDB = null;
try {
checkDB = SQLiteDatabase.openDatabase(DB_PATH +
DATABASE_NAME, null, SQLiteDatabase.OPEN_READONLY);
checkDB.close();
} catch (SQLiteException e) {

}
return checkDB != null ? true : false;
}
}

//André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Re: Apk file size limit / number of files limit

2011-08-25 Thread Raphael André Bauer
On Wed, Aug 24, 2011 at 6:54 PM, Chris Stratton  wrote:
> On Wednesday, August 24, 2011 12:43:16 PM UTC-4, Drezden wrote:
>>
>> I would also suggest that you look into ways to pull your tiles from
>> the web instead of storing them on the device.  You very rarely see
>> apps in the wild that have a larger footprint than 20mb and some
>> devices like the G1 only have 70mb of storage TOTAL for all apps.  So
>> you're basically asking someone to remove everything from their device
>> to load your app.
>
> Yes, traditional versions of android it would indeed be preferable to
> download the large dataset seperately and store it on the external storage
> ("sdcard").
>
> However, for devices which permit installation to external storge or for
> honeycomb and later where it's all the same pool of flash blocks anyway, the
> difference would be a short initial download followed by a long data
> download within the app when it is first run.
>
> While it's tempting to think that data delivered in the apk is more secure,
> it's fairly trivial to extract.  However data placed in external storage can
> be modified more easily, so might need a fingerprint check.
>
>> > My observation is: When the asset folder contains around 80mb of
>> > files, the app works nicely both on the emulator and on my nexus one.
>> > When it's larger than 80mb it crashes on both devices. the devises are
>> > running 2.3.3 Api level 10 (but it happens on 3.2, too).
>
> Just to make sure the problem is on the running end and not the building
> end, it could be worth opening the apk (it's just a carefully constructed
> zip file with a funny name) on a pc and verifying that all the files are
> there.

Yea. Should be okay...

Thanks a lot for the advice - really helps to understand how things
are intended to work on android :)

Do you know any examples and code snipplets that show how to implement
such a download-at-start function best? I guess there is a lot to take
into account like storage available, where to store stuff and so on...


Thanks a lot again :)

Best,


Raphael




>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en



-- 
inc: http://ars-machina.raphaelbauer.com
tech: http://ars-codia.raphaelbauer.com
web: http://raphaelbauer.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] TextToSpeech problem

2011-08-24 Thread André
I'm trying to implement TTS into my app, I started by making a test
app to try all the functions first which works fine.
But when I try to implement it into the actual app it doesn't


private TextToSpeech tts = null;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

tts = new TextToSpeech(this, this);

...
}

@Override
public void onInit(int status) {
boolean isAvailable = (TextToSpeech.SUCCESS == status);
...
}

in onInit on my test app I get status 0 which is success. But in the
other one I get -1 no matter what I do. From what I can see the code
is exactly the same but for some reason it doesn't work. The code
above is from the not working one.

Any suggestions? Is there a tiny permission or something I'm missing?

//André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Apk file size limit / number of files limit

2011-08-24 Thread Raphael André Bauer
Hi,


I am currently developing a PhoneGap application - but I am pretty
sure that my problem is way more related to Android than to PhoneGap.
My app consists of a directory assets/www/maps. In this folder is a
huge amount of image files that are tiles for a map library.

My observation is: When the asset folder contains around 80mb of
files, the app works nicely both on the emulator and on my nexus one.
When it's larger than 80mb it crashes on both devices. the devises are
running 2.3.3 Api level 10 (but it happens on 3.2, too).

The error messages are not really helpful ("error parsing apk file"
popup on nexus and "cannot read Android Manifest" via logcat on
emulator).

I am really a newbie on Android, so I am a bit lost here. I already
tried to increase the partition size of my emulator like that:
"emulator -avd avd -partition-size 2047" - but this did not help.

Any pointers how to continue debugging would be really great. If there
are any limits on the amount of files / size of an apk let me know. I
am not aware of any limits - and afaik the 50mb limit of Android apps
distributed via the Android Market was lifted some time ago.


Thanks a lot :)

Raphael
ps. I also cross posted my question at the phongap list:
http://groups.google.com/group/phonegap/browse_thread/thread/8333095f7daae5a0
- but got no answer.



















-- 
inc: http://ars-machina.raphaelbauer.com
tech: http://ars-codia.raphaelbauer.com
web: http://raphaelbauer.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Problem getting string from database

2011-08-04 Thread André
Some how I can't get that to work. I've made it work before exactly
like you mentioned with info.id but now it doesn't work.
This time I'm using a custom listview with checkboxes, could this have
anything to do with it?
I made a work around though, I added the _id when first filling the
list as a long for every post. So when I select an item and open the
context menu it takes the _id from the custom listview instead and
then it works.

Thanks for your suggetions!
André


On Aug 3, 4:58 pm, Kostya Vasilyev  wrote:
> Hard to say what's going on in that code, but basically, you want to use
> the database _id value as much as possible (preferably, always), and not
> positions within the cursor's result set.
>
> Adapters have getItemId - make sure you return the value of your _id
> column, which is independent of the item's position within the list.
> This value will be carried into your onContextItemSelected as info.id.
>
> -- Kostya
>
> 03.08.2011 18:30, André пишет:
>
> > When I tried again on the second post instead I get row number 1. So
> > the first post is 0 and the second is 1. So when I read the second one
> > I get the info from the first post.
>
> --
> Kostya Vasilyev

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Problem getting string from database

2011-08-03 Thread André
When I tried again on the second post instead I get row number 1. So
the first post is 0 and the second is 1. So when I read the second one
I get the info from the first post.
I use this from a context menu to get the row:

AdapterContextMenuInfo info = (AdapterContextMenuInfo)
item.getMenuInfo();
switch(item.getItemId()) {
case DELETE_ID:
mDbHelper.deleteTask(info.id);
fillData();
return true;
case EDIT_ID:
long l = info.id;
addDaily(info.id);
return true;
}

Adding +1 after info.id feels wrong. Is there a better way to do this
more exact you think?

André

On Aug 3, 4:07 pm, Kostya Vasilyev  wrote:
> Bingo.
>
> Cursor data is organized into rows and columns.
>
> If there are zero rows, you won't be able to get any data, and it's in
> fact an error to try - as you'd be asking for data from row 0 out of 0 -
> exactly as the exception error message says.
>
> -- Kostya
>
> 03.08.2011 17:23, André пишет:
>
> > Thanks for the quick reply.
> > It says that there is 0 rows when using get count. Is it a problem
> > with the row number I provide it you think?
>
> > André
>
> --
> Kostya Vasilyev

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Problem getting string from database

2011-08-03 Thread André
Thanks for the quick reply.
It says that there is 0 rows when using get count. Is it a problem
with the row number I provide it you think?

André

On Aug 3, 3:01 pm, Kostya Vasilyev  wrote:
> Most likely, your cursor doesn't contain any data rows. Use
> cursor.getCount (or cursor.moveToNext) to check.
>
> 03.08.2011 16:51, André пишет:
>
> > Any suggestions?
>
> --
> Kostya Vasilyev

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Problem getting string from database

2011-08-03 Thread André
Hi,
I'm trying to get a string from my database. My cursor gets the right
row and everything, and there is no problem to get the columnIndex.
But when I use "getString" I get this exception in logcat:

08-03 14:27:42.974: ERROR/AndroidRuntime(31026): Caused by:
android.database.CursorIndexOutOfBoundsException: Index 0 requested,
with a size of 0

this is the code I have.

Cursor cursor = (Cursor) mDbHelper.fetchNote(row);
startManagingCursor(cursor);
if (cursor != null) {
 
addTitle.setText(cursor.getString(cursor.getColumnIndexOrThrow(DbAdapter.KEY_TITLE)));
}

Any suggestions?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Problem adding post to database.

2011-08-01 Thread André
Nevermind, I forgot to open the dbadapter in the dialog activity.

On Aug 1, 7:38 pm, André  wrote:
> I have two places in my code where I want to insert data to a
> database. The first place is in my main activity and it works fine.
> The second one is in a dialog activity which works fine except for the
> insert to database part. There are no errors showing in eclipse but
> when I get to the line where it tries to use long id =
> db.createTask(string, string, string) (which is more or less a copy of
> the notepad example) I get a force close. It never even enters my
> Database adapter class. And the stacktrace also refers to this line.
> Same problem occurs when I make an exact copy of the working one in
> the main activity.
> Is there something I might forget or has someone had a similar problem
> before?
>
> //André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Problem adding post to database.

2011-08-01 Thread André
I have two places in my code where I want to insert data to a
database. The first place is in my main activity and it works fine.
The second one is in a dialog activity which works fine except for the
insert to database part. There are no errors showing in eclipse but
when I get to the line where it tries to use long id =
db.createTask(string, string, string) (which is more or less a copy of
the notepad example) I get a force close. It never even enters my
Database adapter class. And the stacktrace also refers to this line.
Same problem occurs when I make an exact copy of the working one in
the main activity.
Is there something I might forget or has someone had a similar problem
before?

//André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Save user options in reboot

2011-06-16 Thread André Coelho
Take a look at this 
http://developer.android.com/reference/android/content/SharedPreferences.html
and this 
http://saigeethamn.blogspot.com/2009/10/shared-preferences-android-developer.html

Those links will help you achieve what you want. SharedPreferences
does exactly what you want.

On Jun 16, 7:31 pm, Amita Dev  wrote:
> Hi,
>     Is it possible to save user selected options even after reboot of
> device?
> I would like to not to write all of my data in a file and then read it back.
>
> How do all applications save data even after reboot?
>
> Thanks,
> -A

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: NFC P2P pattern: Receive first, via NPP, and respond after also via NPP

2011-06-15 Thread André Cruz
Nevermind… I just needed an agent on the Debian side to perform the
SSP "JustWorks" pairing.

Thanks,
André

On 14 Jun, 21:38, André Cruz  wrote:
> Bluetooth with createInsecureRfcommSocketToServiceRecord() or
> listenUsingInsecureRfcommWithServiceRecord() would be an option, so
> that pairing is not needed, but I've yet to successfully establish a
> RFCOMM channel this way with devices other than Androids. In my case
> I'm trying to establish a connection with a Debian system and I can't
> seem to configure the Bluez framework there to create these insecure
> channels, it always requires pairing…
>
> Best regards,André
>
> On 9 Jun, 13:20, Nick Pelly  wrote:
>
>
>
> > The current NPP API's do not encourage the use of NPP for
> > challenge/response.
>
> > However you can use NPP to exchange enough information to switch to
> > Bluetooth, for which we have public API's for an RFCOMM channel.
>
> > Cheers,
> > Nick
>
> > On Mon, May 30, 2011 at 1:02 PM,AndréCruz  wrote:
> > > Hello.
>
> > > I've successfully established a LLCP connection between a SCL3711 desktop
> > > reader (using nfcpy) and a Nexus S. I've also implemented NPP client and
> > > server support so I can send NDEF messages from the desktop and receive 
> > > them
> > > on the Android, and vice-versa.
>
> > > But I am struggling with the AndroidNFCAPI to accomplish something as
> > > simple as receiving a NPP message first, and then sending a response also
> > > via NPP. This is because the enableForegroundNdefPush() call has to be
> > > executed on the onResume() method and the NdefPushClient only sends the
> > > message if it is available as soon as the LLCP channel is established.
>
> > > In my use case the phone would be put next to my reader, which would
> > > trigger the establishment of a LLCP channel, and the reader would push an
> > > NDEF message. My application is launched, it is the only one that catches
> > > that specific intent, and produce a NDEF response based on the NDEF 
> > > received
> > > and would push it to the reader via enableForegroundNdefPush(). But by now
> > > the LLCP channel is established, so the message does not get sent, and my
> > > application is processing the onNewIntent() method so I can't
> > > use enableForegroundNdefPush().
>
> > > Am I doing something wrong? Surely this simple use case must be possible 
> > > to
> > > implement.
>
> > > Thanks,
> > >André
>
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "Android Developers" group.
> > > To post to this group, send email to android-developers@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > android-developers+unsubscr...@googlegroups.com
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: NFC P2P pattern: Receive first, via NPP, and respond after also via NPP

2011-06-14 Thread André Cruz
Bluetooth with createInsecureRfcommSocketToServiceRecord() or
listenUsingInsecureRfcommWithServiceRecord() would be an option, so
that pairing is not needed, but I've yet to successfully establish a
RFCOMM channel this way with devices other than Androids. In my case
I'm trying to establish a connection with a Debian system and I can't
seem to configure the Bluez framework there to create these insecure
channels, it always requires pairing…

Best regards,
André

On 9 Jun, 13:20, Nick Pelly  wrote:
> The current NPP API's do not encourage the use of NPP for
> challenge/response.
>
> However you can use NPP to exchange enough information to switch to
> Bluetooth, for which we have public API's for an RFCOMM channel.
>
> Cheers,
> Nick
>
>
>
> On Mon, May 30, 2011 at 1:02 PM, André Cruz  wrote:
> > Hello.
>
> > I've successfully established a LLCP connection between a SCL3711 desktop
> > reader (using nfcpy) and a Nexus S. I've also implemented NPP client and
> > server support so I can send NDEF messages from the desktop and receive them
> > on the Android, and vice-versa.
>
> > But I am struggling with the Android NFC API to accomplish something as
> > simple as receiving a NPP message first, and then sending a response also
> > via NPP. This is because the enableForegroundNdefPush() call has to be
> > executed on the onResume() method and the NdefPushClient only sends the
> > message if it is available as soon as the LLCP channel is established.
>
> > In my use case the phone would be put next to my reader, which would
> > trigger the establishment of a LLCP channel, and the reader would push an
> > NDEF message. My application is launched, it is the only one that catches
> > that specific intent, and produce a NDEF response based on the NDEF received
> > and would push it to the reader via enableForegroundNdefPush(). But by now
> > the LLCP channel is established, so the message does not get sent, and my
> > application is processing the onNewIntent() method so I can't
> > use enableForegroundNdefPush().
>
> > Am I doing something wrong? Surely this simple use case must be possible to
> > implement.
>
> > Thanks,
> > André
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Good phone for development - and getNeighboringCellInfo()

2011-06-11 Thread André Coelho
I have done something similar to what you want. I developed an application
that we needed for a study.
It collects GSM and WiFI data, stores it in a file that I later process with
a perl script. The script sends GSM and WiFi data to Google's geolocation
api and retrieves location coordinates (like those in GPS).
We needed a way to annotate events with location data without the user
incurring any costs. Location information is critical to our work but
doesn't really need to be calculated immediately.
We wrote a paper on it with results of how accurate this method was, turned
out to be pretty good.
WiFi info gets you a better location then GSM (more precise) and sending
both WiFi and gsm doesn't do any better than just WiFi.
Also, there is a caveat if you don't operate the phone strictly in 2G mode
the method that retrieves neighbouring cell info returns -1 for all data.
You can only get information from the cell you are connected to when in 3G.
It's a limitation of the API.
No dia 10 de Jun de 2011 02:39, "Davide Ronchi"  escreveu:

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Good phone for development - and getNeighboringCellInfo()

2011-06-11 Thread André Coelho
Sorry, I think i might have mailed you a response more than once.

On Jun 9, 4:21 pm, Davide Ronchi  wrote:
> Hi all.
>
> I am about to start an Android development project. I would like some
> advice before starting with the project.
>
> First of all, I have done some research on which phone would be the
> best to do Android development. I have seen many suggestions, but most
> people seem to point at the Google Nexus One (or its UK equivalent,
> the HTC Desire). I was wondering if there is anything more recent that
> is as good as the Nexus One. I have seen people suggesting the Nexus
> S, but I'd rather not use a Samsung phone for the reason I'll explain
> below. Also, the HTC Desire S seems to have a signed bootloader, and
> I'd like to be able to tinker with the OS if I will need to during the
> project (this is not a commercial application, it's more of a research
> project, so it's ok if I need to modify the OS). The HTC Desire HD
> seems more like a modern alternative to the Desire, but I have found
> no one suggesting it as a good, modern developer phone for Android.
> Any other suggestion?
>
> For this project I will need to triangulate the user's location using
> GSM cell info. Problem is that sometimes, we will need to triangulate
> the position *after* the phone has lost signal (i.e. the user has
> gotten into an underground transport system). I was thinking of two
> possible strategies to do so:
> 1. write an application that stays in the background and uses
> LocationManager + LocationManager.NETWORK_PROVIDER to receive location
> updates from the network provider and then use the latest known
> location
> 2. log all the cell IDs I see and use the last few ones (together with
> their known location) at a later time to triangulate the user's
> location
>
> Strategy #1 has the obvious advantage that it is supported by most
> Android phones and works reasonably well for what I need to do.
> Problem is, it will drain the user's battery. Even if it is relatively
> cheap to use Network Location instead of GPS to locate the user, I
> need only to locate the user when he/she enters the public transit
> network. If the user goes out of town, my application will keep
> querying the location provider for nothing.
>
> Strategy #2 works reasonably well for my purposes, as I suppose the
> phone will see a different set of cells depending on the entry point
> (and therefore it might not even be necessary to do the actual
> triangulation, I could build a database of (Station Name, Set of
> visible cells) tuples and consult it without even bothering
> translating that into actual coordinates. Also, logging the cell
> information is something that can be done substantially for free, as
> the phone already has that information and I am only reading it and
> discarding it if I don't need it. Trouble is, in this case, that I
> have seen that the function for doing this on Android don't always
> work well on all phones. I know, by reading previous posts on this
> forum, that Samsung phones don't support getNeighboringCellInfo().
> Also, many *other* phones don't support that function.
>
> I was wondering: is there anyone here who knows of a current phone
> that supports getNeighboringCellInfo() *for sure*?
>
> Thanks,
> Davide

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Good phone for development - and getNeighboringCellInfo()

2011-06-11 Thread André Coelho
I have done something similar to what you are trying to do. We ran a study a
while back where we compared the accuracy and precision of a time-shifted
location process vs an on-demand one. We wrote an article with our results.
We collected GSM and WiFi data on several locations and we also collected
the Android's Network Provider location coordinates. The GSM and WiFi data
we collected was processed by a perl script that sends the infor to Google's
geolocation API and parses the response with the result (which is location
coordinates).
We found that our method was pretty good compared to the location the device
serves up on-site. Our purpose was to develop a way to annotate events with
location data without the users of our apps incurring in any costs.
There is a caveat you should know about, it's a limitation of the API. If
you are operating your phone in 3G mode you can only get information for the
cell you are connected to, all information from neighbouring cells will show
up with the value -1. However, if you change the radio to operate strictly
in 2G mode, then all neighbouring cell information shows up just fine when
you call the method from the API.
Additionally, from our results, I can tell you that using just GSM data
doesn't provide you with very precise location data. Either use GSM+WiFi or
just WiFi which have nearly identical results. Anyway, it obviously depends
on how precise you want your location data to be.

Regards,
André Coelho

2011/6/9 Davide Ronchi 

> Hi all.
>
> I am about to start an Android development project. I would like some
> advice before starting with the project.
>
> First of all, I have done some research on which phone would be the
> best to do Android development. I have seen many suggestions, but most
> people seem to point at the Google Nexus One (or its UK equivalent,
> the HTC Desire). I was wondering if there is anything more recent that
> is as good as the Nexus One. I have seen people suggesting the Nexus
> S, but I'd rather not use a Samsung phone for the reason I'll explain
> below. Also, the HTC Desire S seems to have a signed bootloader, and
> I'd like to be able to tinker with the OS if I will need to during the
> project (this is not a commercial application, it's more of a research
> project, so it's ok if I need to modify the OS). The HTC Desire HD
> seems more like a modern alternative to the Desire, but I have found
> no one suggesting it as a good, modern developer phone for Android.
> Any other suggestion?
>
> For this project I will need to triangulate the user's location using
> GSM cell info. Problem is that sometimes, we will need to triangulate
> the position *after* the phone has lost signal (i.e. the user has
> gotten into an underground transport system). I was thinking of two
> possible strategies to do so:
> 1. write an application that stays in the background and uses
> LocationManager + LocationManager.NETWORK_PROVIDER to receive location
> updates from the network provider and then use the latest known
> location
> 2. log all the cell IDs I see and use the last few ones (together with
> their known location) at a later time to triangulate the user's
> location
>
> Strategy #1 has the obvious advantage that it is supported by most
> Android phones and works reasonably well for what I need to do.
> Problem is, it will drain the user's battery. Even if it is relatively
> cheap to use Network Location instead of GPS to locate the user, I
> need only to locate the user when he/she enters the public transit
> network. If the user goes out of town, my application will keep
> querying the location provider for nothing.
>
> Strategy #2 works reasonably well for my purposes, as I suppose the
> phone will see a different set of cells depending on the entry point
> (and therefore it might not even be necessary to do the actual
> triangulation, I could build a database of (Station Name, Set of
> visible cells) tuples and consult it without even bothering
> translating that into actual coordinates. Also, logging the cell
> information is something that can be done substantially for free, as
> the phone already has that information and I am only reading it and
> discarding it if I don't need it. Trouble is, in this case, that I
> have seen that the function for doing this on Android don't always
> work well on all phones. I know, by reading previous posts on this
> forum, that Samsung phones don't support getNeighboringCellInfo().
> Also, many *other* phones don't support that function.
>
> I was wondering: is there anyone here who knows of a current phone
> that supports getNeighboringCellInfo() *for sure*?
>
> Thanks,
> Davide
>
> --
> You received this message because you are subscrib

[android-developers] Content Provider using external file storage (text file)

2011-06-09 Thread André Coelho
I'm trying to code a system for running user studies. I have a webpage
and a webservice on top of a user DB.
My Android app is a client to run the studies on. I'm use the Account
Manager to store user credentials authenticated via the webservice.
The point is to then implement a sync adapter that will send a text
file with study data to my server, via the webservice (using the
credentials).

My problem is that I'm having difficulty with the Content Provider,
I've searched a lot throught the web but I can't seem to find an
example of how to code a Content Provider tied to a file on external
storage. All the examples I find use Content Providers tied to
database tables. Can someone please point me in the right direction or
shed some coding light? (BTW, I have read the Android Developer texts
on Content Providers, also, I'm using Android 2.2).

Any help is appreciated.

Cheers,
André Coelho

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Bluetooth: Can't connect to socket on a linux box

2011-06-09 Thread André Cruz
Nevermind… I was under the impression that the valid range for RFCOMM
ports was 1-255 and not 1-30.

André

On 9 Jun, 11:12, André Cruz  wrote:
> Hello.
>
> I'm running theBluetoothChat example trying to trick it into
> connecting to alinuxbox where I have a service registered with the
> UUID of the chat service, but although it finds the service, it never
> connects and throws an error:
>
> D/BluetoothChat( 4078): onActivityResult -1
> D/BluetoothChatService( 4078): connect to: 00:1F:5B:DF:5F:17
> D/BluetoothChatService( 4078): setState() 1 -> 2
> E/BluetoothChat( 4078): + ON RESUME +
> I/BluetoothChat( 4078): MESSAGE_STATE_CHANGE: 2
> I/BluetoothChatService( 4078): BEGIN mConnectThread
> SocketType:Insecure
> E/BluetoothService.cpp(  109): stopDiscoveryNative: D-Bus error in
> StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)
> E/BluetoothService.cpp(  109): stopDiscoveryNative: D-Bus error in
> StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)
> E/BluetoothEventLoop.cpp(  109): event_filter: Received signal
> org.bluez.Device:PropertyChanged from /org/bluez/280/hci0/
> dev_00_1F_5B_DF_5F_17
> D/BluetoothService(  109): updateDeviceServiceChannelCache(00:1F:5B:DF:
> 5F:17)
> D/BluetoothService(  109):      uuid(application): 8ce255c0-200a-11e0-
> ac64-0800200c9a66 210
> D/BluetoothService(  109): Making callback for 8ce255c0-200a-11e0-
> ac64-0800200c9a66 with result 210
> E/BluetoothChatService( 4078): unable to connect()
> E/BluetoothChatService( 4078): java.io.IOException: Invalid argument
> E/BluetoothChatService( 4078):  at
> android.bluetooth.BluetoothSocket.connectNative(Native Method)
> E/BluetoothChatService( 4078):  at
> android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:204)
> E/BluetoothChatService( 4078):  at
> com.example.android.BluetoothChat.BluetoothChatService
> $ConnectThread.run(BluetoothChatService.java:387)
> D/BluetoothChatService( 4078): start
> D/BluetoothChatService( 4078): setState() 2 -> 1
>
> So from the log we can see that the service is found, but for some
> reason the connect() fails with errno=EINVAL. I haven't rooted this
> Nexus S so I cannot know more about what the native code is doing, but
> has anyone encountered this? Connecting to another Android phone
> works, of course.
>
> Thanks,
> André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Bluetooth: Can't connect to socket on a linux box

2011-06-09 Thread André Cruz
Hello.

I'm running the Bluetooth Chat example trying to trick it into
connecting to a linux box where I have a service registered with the
UUID of the chat service, but although it finds the service, it never
connects and throws an error:

D/BluetoothChat( 4078): onActivityResult -1
D/BluetoothChatService( 4078): connect to: 00:1F:5B:DF:5F:17
D/BluetoothChatService( 4078): setState() 1 -> 2
E/BluetoothChat( 4078): + ON RESUME +
I/BluetoothChat( 4078): MESSAGE_STATE_CHANGE: 2
I/BluetoothChatService( 4078): BEGIN mConnectThread
SocketType:Insecure
E/BluetoothService.cpp(  109): stopDiscoveryNative: D-Bus error in
StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)
E/BluetoothService.cpp(  109): stopDiscoveryNative: D-Bus error in
StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)
E/BluetoothEventLoop.cpp(  109): event_filter: Received signal
org.bluez.Device:PropertyChanged from /org/bluez/280/hci0/
dev_00_1F_5B_DF_5F_17
D/BluetoothService(  109): updateDeviceServiceChannelCache(00:1F:5B:DF:
5F:17)
D/BluetoothService(  109):  uuid(application): 8ce255c0-200a-11e0-
ac64-0800200c9a66 210
D/BluetoothService(  109): Making callback for 8ce255c0-200a-11e0-
ac64-0800200c9a66 with result 210
E/BluetoothChatService( 4078): unable to connect()
E/BluetoothChatService( 4078): java.io.IOException: Invalid argument
E/BluetoothChatService( 4078):  at
android.bluetooth.BluetoothSocket.connectNative(Native Method)
E/BluetoothChatService( 4078):  at
android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:204)
E/BluetoothChatService( 4078):  at
com.example.android.BluetoothChat.BluetoothChatService
$ConnectThread.run(BluetoothChatService.java:387)
D/BluetoothChatService( 4078): start
D/BluetoothChatService( 4078): setState() 2 -> 1

So from the log we can see that the service is found, but for some
reason the connect() fails with errno=EINVAL. I haven't rooted this
Nexus S so I cannot know more about what the native code is doing, but
has anyone encountered this? Connecting to another Android phone
works, of course.

Thanks,
André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Reader/Transmitter for P2P on NFC

2011-06-02 Thread André Cruz
Have you tried nfcpy? It supports LLCP and, soon, NPP. So all the
bolts are there for NFC P2P.

André

On 25 Maio, 06:57, mduffy215  wrote:
> Has anyone found a reader/transmitter for P2P onNFC.
>
> Basically, I want to establish a communications channel between my
> Nexus S and my desktop usingNFC.
>
> The ACR 122 U looks promising, but is not there 
> yet:http://www.libnfc.org/community/topic/401/p2p-communication-between-a...

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] NFC P2P pattern: Receive first, via NPP, and respond after also via NPP

2011-06-01 Thread André Cruz
Hello.

I've successfully established a LLCP connection between a SCL3711 desktop 
reader (using nfcpy) and a Nexus S. I've also implemented NPP client and 
server support so I can send NDEF messages from the desktop and receive them 
on the Android, and vice-versa.

But I am struggling with the Android NFC API to accomplish something as 
simple as receiving a NPP message first, and then sending a response also 
via NPP. This is because the enableForegroundNdefPush() call has to be 
executed on the onResume() method and the NdefPushClient only sends the 
message if it is available as soon as the LLCP channel is established.

In my use case the phone would be put next to my reader, which would trigger 
the establishment of a LLCP channel, and the reader would push an NDEF 
message. My application is launched, it is the only one that catches that 
specific intent, and produce a NDEF response based on the NDEF received and 
would push it to the reader via enableForegroundNdefPush(). But by now the 
LLCP channel is established, so the message does not get sent, and my 
application is processing the onNewIntent() method so I can't 
use enableForegroundNdefPush().

Am I doing something wrong? Surely this simple use case must be possible to 
implement.

Thanks,
André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] ActionBar Tabs

2011-05-10 Thread André
Hi,

I'm trying to customize the look of my tabs in the actionbar by
following this tutorial:
http://androidunlocked.net/archive/customizing-the-action-bar/
But I can't figure out how to change the standard blue line that is a
little bit thicker when the tab is selected to a different colour.
Any ideas of how I could achieve this?

Regards
André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: (Full) NFC support for Android (on a Nexus S, specifically)

2011-04-20 Thread André Cruz
Is it possible, with the current android API, to communicate using
peer-to-peer NFC with a desktop reader/writer using libnfc?

Thanks,
André

On 4 Abr, 15:15, Nick Pelly  wrote:
> We're not in a hurry to add public API's for Card Emulation. It is a
> developers nightmare because most NFC hardware will only support one type of
> card emulation technology. And there are at least 4 very common types
> (Felica, Mifare Classic, Mifare Desire, ISO-DEP). So a developer would need
> to understand all these types and the inter-operability issues, and choose
> which set of phones to write their application for.
>
> Not to mention dealing with multiple apps that all want to do card
> emulation. Take Mifare as an example, how would the user decide which
> application gets to control the Mifare Application Directory? Yes it is
> possible to construct a combination of API's and system UI that lets the
> user choose which application gets to do card emulation. But we have to
> introduce API complexity and, cognitive overhead for the user.
>
> As a third party developer, I highly encourage you to invest in peer-to-peer
> NFC. This can easily handle multiple applications, and is guaranteed to work
> across all Android phones.
>
> Cheers,
> Nick
>
>
>
> On Thu, Mar 31, 2011 at 1:36 PM, nadam  wrote:
> > It would be nice to get a hint on when card emulation will be added as
> > an official feature of the SDK. It's already mentioned in the source
> > code (NfcAdapter.java) but hidden with @hide.
>
> >    /**
> >     * Card Emulation mode Enables the manager to act as an NFC tag.
> > Provided
> >     * that a Secure Element (an UICC for instance) is connected to
> > the NFC
> >     * controller through its SWP interface, it can be exposed to the
> > outside
> >     * NFC world and be addressed by external readers the same way
> > they would
> >     * with a tag.
> >     * 
> >     * Which Secure Element is exposed is implementation-dependent.
> >     *
> >     * @hide
> >     */
> >    private static final int DISCOVERY_MODE_CARD_EMULATION = 2;
>
> > It seems to be possible to enable this somehow (http://www.youtube.com/
> > watch?v=28TwCpx4Dng) but I don't know if it requires Java reflection,
> > NDK programming or a custom Android build.
>
> > On 31 mar, 04:39, Dianne Hackborn  wrote:
> > > The platform so far supports what is in the SDK.  It doesn't matter what
> > a
> > > particular piece of hardware supports.
>
> > > It is enough to be "useful in practice."  It may not be enough for what
> > > *you* want to do, and we understand that it does not do everything for
> > > everyone at this point, but this is what is there so far.
>
> > > On Wed, Mar 30, 2011 at 3:03 AM, JMC114  wrote:
> > > > Greetings,
>
> > > > After sifting through documentation and building NFC test applications
> > > > on a Nexus S, I've come to the conclusion the Android SDK still lacks
> > > > the functionality that NFC applications truly need in order to really
> > > > be useful in practice.
>
> > > > What's possible now:
> > > > - Reading and writing tags.
> > > > - P2P NDEF communication.
>
> > > > What's missing:
> > > > - Card emulation
> > > > - P2P NDEF support on terminals/readers (which I'm given to understand
> > > > is known as com.android.npp? NDEF Push Protocol. Can't find any
> > > > documentation on that anywhere..) which - I believe - is (still)
> > > > needed for P2P communication with regular desktop readers
>
> > > > As far as I can tell, the NFC controller chip (PN544
> > > >http://www.nxp.com/acrobat_download2/literature/9397/75016890.pdf) in
> > > > the Nexus S supports all NFC functionality, the android SDK does not.
>
> > > > Card emulation or proper documentation on how to initiate P2P
> > > > communication with a regular (desktop) (nfc) reader is very much a
> > > > requirement to unleash NFC's true potential, which is mobile payment.
>
> > > > It seems impossibly hard to find any information on whether or not
> > > > this - in my opinion vital - functionality is due to be implemented.
>
> > > > Does anyone have any information, thoughts, opinions, anything on this
> > > > subject? I'm really wondering what to expect from Android and NFC,
> > > > because frankly, I'm only half impressed so far.
>
> > > > Thanks
>
> > > > -

[android-developers] ActionBar Tabs Fragment EditText instance

2011-04-18 Thread André
I'm working on an app that has multiple tabs in the ActionBar in
Honeycomb, every tab extends a fragment and every fragment is an
instance of the same class. So in every fragment I have a edittext
with the same name.
What I want to do is to be able to do is to reach this edittext in the
selected tab and extract the text from it in a different fragment that
is not a part of the tabs.
Does anyone have a suggestion of how what I can do to achieve this?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] How does Morelocale 2 works?

2011-03-28 Thread André Mariano
Hi guys, I'm trying to understand how Morelocale 2 works, How does it
change the language of the android system?
Well, I want to do a "Language pack" for my brothers that don't know
English, But I have no idea how to start, because the only apps I
developed, didn't change anything of the system

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Where can I find the samsung android api docs?

2011-03-25 Thread André
What I want to do is to read a file to a edittext, but on samsung
phones it cuts off at about 10 kb which sucks. It works fine on every
other device except samsung. I've tried buffered reader, input streams
and everything else I can think of, but still no luck.
I've asked this question here before but no one seems to know the
answer. So instead, does anyone know a good place where I might find
some answers to this problem?

Cheers
André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Reading files, cut off at 10kb on samsungs

2011-03-22 Thread André
Does anyone know why some samsung phones stops reading files at around
10kb? And what a solution could be?
I am using this to open files right now which works on every other
phone:

FileInputStream fileIS = new FileInputStream(file);
BufferedReader in = new BufferedReader(new InputStreamReader(fileIS));
do {
st = in.readLine();
if (st != null) {
mEditText.append(st);
mEditText.append(String.valueOf(lf));
}
} while (st != null);
in.close();

Any suggestions?

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Edittext landscape - not full screen

2011-03-02 Thread André
The answer is this:

mEditText.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);

if anyone else looks for it!


On Mar 2, 10:40 am, André  wrote:
> In my app my edittext changes to full screen when it's focused and in
> landscape. I have seen apps that has worked around some how so that
> the soft keyboard just ends up being on top of the edittext.
> Any suggestions of how I can achieve this?
>
> // André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Edittext landscape - not full screen

2011-03-02 Thread André
In my app my edittext changes to full screen when it's focused and in
landscape. I have seen apps that has worked around some how so that
the soft keyboard just ends up being on top of the edittext.
Any suggestions of how I can achieve this?

// André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Portrait and Landscape layouts

2011-02-22 Thread André
Stupid miss of me. I had put finish() inside ondestroy. Not a good
combination.

But the verify locale en_ES is weird. I do have Spanish phone but the
locale is set on English.
Maybe thats what HTC does on their localized phones?

//André

On Feb 22, 3:45 pm, Kostya Vasilyev  wrote:
> 22.02.2011 17:41, André пишет:
>
> > at com.testapp.views.MainActivity.onDestroy(MainActivity.java:530)
>
> You have code that tries to access a null pointer, in MainActivity.java,
> line 530.
>
> --
> Kostya Vasilyev --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Portrait and Landscape layouts

2011-02-22 Thread André
This is the stack trace I get. Any Ideas?

java.lang.RuntimeException:
Unable to destroy activity {com.testapp.views/
com.testapp.views.MainActivity}: java.lang.NullPointerException
at
android.app.ActivityThread.performDestroyActivity(ActivityThread.java:
3948)
at
android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:
4011)
at
android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:
4127)
at android.app.ActivityThread.access$2400(ActivityThread.java:136)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:
2183)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:143)
at android.app.ActivityThread.main(ActivityThread.java:5068)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)

Caused by: java.lang.NullPointerException
at com.testapp.views.MainActivity.onDestroy(MainActivity.java:530)
at
android.app.ActivityThread.performDestroyActivity(ActivityThread.java:
3935)
... 12 more


On Feb 22, 3:20 pm, Mark Murphy  wrote:
> None of those are errors. You will be looking for a Java stack trace.
>
>
>
>
>
>
>
>
>
> On Tue, Feb 22, 2011 at 9:03 AM, André  wrote:
> > 02-22 14:38:15.941: VERBOSE/upgrading(1430): onConfigurationChanged to
> > call verify locale
> > 02-22 14:38:15.951: INFO/upgrading(1430): verifyLocale status: 0
> > 02-22 14:38:15.951: INFO/upgrading(1430): verifyLocale providerLocale:
> > en_ES
> > 02-22 14:38:15.951: INFO/UsageStats(1297): Unexpected resume of
> > com.testapp.views while already resumed in com.testapp.views
> > 02-22 14:38:20.947: WARN/WindowManager(1297): App freeze timeout
> > expired.
> > 02-22 14:38:20.947: WARN/WindowManager(1297): Force clearing freeze:
> > AppWindowToken{47f54088 token=HistoryRecord{47a85750
> > com.testapp.views/.MainActivity}}
>
> > This is what I got from the logcat. I think it is here it crashes. Can
> > you read it? Because I don't understand much of it!
>
> > //André
>
> > On Feb 22, 2:26 pm, André  wrote:
> >> I have a problem with the two layouts. When I rotate the phone from
> >> portrait to landscape (and vice versa) in my main activity the
> >> application closes without the force close message. If I start my app
> >> in either landscape or portrait the layouts work, but if I just
> >> switched from either orientation it takes 3 - 5 tries before the
> >> program starts with the outcome that the program just shuts down in
> >> the 3 - 5 attempts.
>
> >> My main activity's layout file is called main.xml and I have this file
> >> in res/layout, res/layout-port & res/layout-land with some
> >> modifictaions in layout-land.
> >> I call setContentView(R.layout.main); from onCreate.
>
> >> Is there something vital I'm missing for this to work?
>
> >> //André
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to Android Development_ Version 3.4 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Portrait and Landscape layouts

2011-02-22 Thread André
Or maybe it's this part.

02-22 14:39:49.921: VERBOSE/WindowManager(1297): Remove
Window{479e6eb0 Starting com.testapp.views paused=false}:
mSurface=Surface(name=Starting com.testapp.views, identity=8795)
mExiting=false isAnimating=false app-animation=null
inPendingTransaction=false mDisplayFrozen=false
02-22 14:39:49.931: ERROR/ActivityManager(1297): fail to set top app
changed!
02-22 14:39:49.951: INFO/WindowManager(1297): WIN DEATH:
Window{47acc2e8 com.testapp.views/com.testapp.views.MainActivity
paused=false}
02-22 14:39:49.951: VERBOSE/WindowManager(1297): Remove
Window{47acc2e8 com..testapp.views/com.testapp.views.MainActivity
paused=false}: mSurface=null mExiting=false isAnimating=false app-
animation=null inPendingTransaction=false mDisplayFrozen=false
02-22 14:39:49.961: INFO/WindowManager(1297): Setting rotation to 0,
animFlags=1
02-22 14:39:49.981: INFO/ActivityManager(1297): Config changed:
{ scale=1.0 imsi=214/1 loc=en_ES touch=3 keys=1/1/2 nav=1/1 orien=1
layout=34 uiMode=17 seq=504 skin=default}
02-22 14:39:49.991: VERBOSE/upgrading(1430): onConfigurationChanged
02-22 14:39:49.991: VERBOSE/upgrading(1430): onConfigurationChanged to
call verify locale
02-22 14:39:49.991: INFO/upgrading(1430): verifyLocale status: 0
02-22 14:39:50.001: INFO/upgrading(1430): verifyLocale providerLocale:
en_ES
02-22 14:39:50.031: INFO/UsageStats(1297): Unexpected resume of
com.htc.launcher while already resumed in com.testapp.views
02-22 14:39:50.041: INFO/ActivityManager(1297): Starting activity:
Intent { act=android.intent.action.MAIN
cat=[android.intent.category.LAUNCHER] flg=0x1000
cmp=com.testapp.views/.MainActivity }
02-22 14:39:50.051: DEBUG/AndroidRuntime(18751): Shutting down VM
02-22 14:39:50.061: DEBUG/dalvikvm(18751): Debugger has detached;
object registry had 1 entries
02-22 14:39:50.071: INFO/AndroidRuntime(18751): NOTE: attach of thread
'Binder Thread #3' failed
02-22 14:39:50.121: DEBUG/InputManagerService(1297): Window already
focused, ignoring focus gain of:
com.android.internal.view.IInputMethodClient$Stub$Proxy@47c49250
02-22 14:39:50.281: INFO/dalvikvm(18424): Jit: resizing JitTable from
8192 to 16384
02-22 14:39:50.441: INFO/[POST_RESELECT](18424): [spanChange] (o,
oldStart, newStart, oldEnd, newEnd)=(android.text.Selection
$START@401cda50,-1,0,-1,0)
02-22 14:39:50.441: INFO/[POST_RESELECT](18424): [spanChange] (o,
oldStart, newStart, oldEnd, newEnd)=(android.text.Selection
$END@40154738,-1,0,-1,0)
02-22 14:39:50.461: INFO/ActivityManager(1297): Start proc
com.testapp.views for activity com.testapp.views/.MainActivity:
pid=18760 uid=10106 gids={3003, 1015}
02-22 14:39:50.551: DEBUG/dalvikvm(1213): GC_EXPLICIT freed 322
objects / 12400 bytes in 87ms
02-22 14:39:50.561: INFO/WindowManager(1297): Setting rotation to 3,
animFlags=1
02-22 14:39:50.581: VERBOSE/upgrading(1430): onConfigurationChanged
02-22 14:39:50.581: VERBOSE/upgrading(1430): onConfigurationChanged to
call verify locale
02-22 14:39:50.581: INFO/upgrading(1430): verifyLocale status: 0
02-22 14:39:50.581: INFO/ActivityManager(1297): Config changed:
{ scale=1.0 imsi=214/1 loc=en_ES touch=3 keys=1/1/2 nav=1/1 orien=2
layout=34 uiMode=17 seq=505 skin=default}
02-22 14:39:50.591: INFO/upgrading(1430): verifyLocale providerLocale:
en_ES
02-22 14:39:50.621: DEBUG/dalvikvm(1213): GC_EXPLICIT freed 57
objects / 2544 bytes in 67ms

Or does anyone know of a logcat translation page or just a place where
I can read about how to read it? Because I don't understand a lot of
it.

//André


On Feb 22, 3:03 pm, André  wrote:
> 02-22 14:38:15.941: VERBOSE/upgrading(1430): onConfigurationChanged to
> call verify locale
> 02-22 14:38:15.951: INFO/upgrading(1430): verifyLocale status: 0
> 02-22 14:38:15.951: INFO/upgrading(1430): verifyLocale providerLocale:
> en_ES
> 02-22 14:38:15.951: INFO/UsageStats(1297): Unexpected resume of
> com.testapp.views while already resumed in com.testapp.views
> 02-22 14:38:20.947: WARN/WindowManager(1297): App freeze timeout
> expired.
> 02-22 14:38:20.947: WARN/WindowManager(1297): Force clearing freeze:
> AppWindowToken{47f54088 token=HistoryRecord{47a85750
> com.testapp.views/.MainActivity}}
>
> This is what I got from the logcat. I think it is here it crashes. Can
> you read it? Because I don't understand much of it!
>
> //André
>
> On Feb 22, 2:26 pm, André  wrote:
>
>
>
>
>
>
>
> > I have a problem with the two layouts. When I rotate the phone from
> > portrait to landscape (and vice versa) in my main activity the
> > application closes without the force close message. If I start my app
> > in either landscape or portrait the layouts work, but if I just
> > switched from either orientation it takes 3 - 5 tries before the
> > program starts with the outcome that the program just shuts down in
> > the 3 - 5 attempts.
>
> > My main activity's 

[android-developers] Re: Portrait and Landscape layouts

2011-02-22 Thread André
02-22 14:38:15.941: VERBOSE/upgrading(1430): onConfigurationChanged to
call verify locale
02-22 14:38:15.951: INFO/upgrading(1430): verifyLocale status: 0
02-22 14:38:15.951: INFO/upgrading(1430): verifyLocale providerLocale:
en_ES
02-22 14:38:15.951: INFO/UsageStats(1297): Unexpected resume of
com.testapp.views while already resumed in com.testapp.views
02-22 14:38:20.947: WARN/WindowManager(1297): App freeze timeout
expired.
02-22 14:38:20.947: WARN/WindowManager(1297): Force clearing freeze:
AppWindowToken{47f54088 token=HistoryRecord{47a85750
com.testapp.views/.MainActivity}}

This is what I got from the logcat. I think it is here it crashes. Can
you read it? Because I don't understand much of it!

//André


On Feb 22, 2:26 pm, André  wrote:
> I have a problem with the two layouts. When I rotate the phone from
> portrait to landscape (and vice versa) in my main activity the
> application closes without the force close message. If I start my app
> in either landscape or portrait the layouts work, but if I just
> switched from either orientation it takes 3 - 5 tries before the
> program starts with the outcome that the program just shuts down in
> the 3 - 5 attempts.
>
> My main activity's layout file is called main.xml and I have this file
> in res/layout, res/layout-port & res/layout-land with some
> modifictaions in layout-land.
> I call setContentView(R.layout.main); from onCreate.
>
> Is there something vital I'm missing for this to work?
>
> //André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Portrait and Landscape layouts

2011-02-22 Thread André
02-22 14:38:15.941: VERBOSE/upgrading(1430): onConfigurationChanged to
call verify locale
02-22 14:38:15.951: INFO/upgrading(1430): verifyLocale status: 0
02-22 14:38:15.951: INFO/upgrading(1430): verifyLocale providerLocale:
en_ES
02-22 14:38:15.951: INFO/UsageStats(1297): Unexpected resume of
com.testapp.views while already resumed in
com.dictatordesigns.silveredit
02-22 14:38:20.947: WARN/WindowManager(1297): App freeze timeout
expired.
02-22 14:38:20.947: WARN/WindowManager(1297): Force clearing freeze:
AppWindowToken{47f54088 token=HistoryRecord{47a85750
com.testapp.views/.MainActivity}}

This is the part from the logcat where I think it crashes. Do you know
what it means?

//André


On Feb 22, 2:29 pm, Kostya Vasilyev  wrote:
> Something vital we're all missing is the logcat output from the crash :)
>
> It's also not necessary to have three versions of the same layout, just
> two is enough: -land & -port, or default & -land.
>
> -- Kostya
>
> 22.02.2011 16:26, André пишет:
>
>
>
>
>
>
>
>
>
> > I have a problem with the two layouts. When I rotate the phone from
> > portrait to landscape (and vice versa) in my main activity the
> > application closes without the force close message. If I start my app
> > in either landscape or portrait the layouts work, but if I just
> > switched from either orientation it takes 3 - 5 tries before the
> > program starts with the outcome that the program just shuts down in
> > the 3 - 5 attempts.
>
> > My main activity's layout file is called main.xml and I have this file
> > in res/layout, res/layout-port&  res/layout-land with some
> > modifictaions in layout-land.
> > I call setContentView(R.layout.main); from onCreate.
>
> > Is there something vital I'm missing for this to work?
>
> > //André
>
> --
> Kostya Vasilyev --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Portrait and Landscape layouts

2011-02-22 Thread André
I have a problem with the two layouts. When I rotate the phone from
portrait to landscape (and vice versa) in my main activity the
application closes without the force close message. If I start my app
in either landscape or portrait the layouts work, but if I just
switched from either orientation it takes 3 - 5 tries before the
program starts with the outcome that the program just shuts down in
the 3 - 5 attempts.

My main activity's layout file is called main.xml and I have this file
in res/layout, res/layout-port & res/layout-land with some
modifictaions in layout-land.
I call setContentView(R.layout.main); from onCreate.

Is there something vital I'm missing for this to work?

//André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: indexOf(ENTER)

2011-02-22 Thread André
Thanks DanH,

using '\n' instead of "\n" worked fine!

Sorry Kostya,
I wasn't clear enough. I meant, if I have a text in a textview that
includes \n as a part of the visual text that the user can see and not
as a newline marker. Then how do I look for the actual new line marker
and not the \n that is a part of the text. Searching for char '\n'
worked very well for that.

Thanks both!

On Feb 21, 10:18 pm, Kostya Vasilyev  wrote:
> 21.02.2011 22:50, André пишет:
>
> > But this string might include \n so I want it to ignore that a go for
> > the value 10 instead. (which is the value for new line if I remember
> > correctly)
>
> The \n *is* the newline marker. So is \12, \x0A, and "char ch = (char)
> 10". By the time you get to string.indexOf, it's all the same.
>
> TextView uses the newline character to represent multiple lines of text
> within a single String (or more precisely, a CharSequence). There isn't
> anything else there between the lines, but the newline character.
>
> So your question really sounds to me like "how do I search for the
> newline markers, in such a way that I don't find any when they're there"
> - which makes no sense to me.
>
> --
> Kostya Vasilyev --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] indexOf(ENTER)

2011-02-21 Thread André
I know this is more of a java question than a android question, but I
know most of you are pro's here an both so I'll ask it here!
Is it possible to search a string that I have taken from an edittext
for when ever the value for new line comes?
But this string might include \n so I want it to ignore that a go for
the value 10 instead. (which is the value for new line if I remember
correctly)
Is this possible or should I use something else of string when I look
for a new line?

Appreciate any answers!
//André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Preventing surface resize on orientation change

2011-02-15 Thread André Santee
I'm making a game with direct OpenGL rendering and I want my menu
always to be vertical. Is there a way I can prevent the phone to reset
it's surface on orientation change?

Regards,
André.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Probelm with getting posts from database

2011-02-10 Thread André

My misstake! I didn't remove cursor.moveToFirst();
So that must have been the problem all the time.
It does return -1. After move to first its 0.

Works fine now!

//André

On Feb 10, 1:22 pm, Kostya Vasilyev  wrote:
> Interesting.
>
> The docs specifically say that query() returns "A Cursor object, which
> is positioned before the first entry." You can test by calling
> cursor.getPosition(), it should be "-1".
>
> Are you moving the cursor *before* that processing loop? (calling any
> move() methods?)
>
> If you're not, then that looks to be a side effect of using a row limit.
>
> -- Kostya
>
> 10.02.2011 15:00, André пишет:
>
>
>
>
>
>
>
>
>
> > Thanks Kostya,
>
> > I did as you suggested and it looks much better.
> > For my question though I got the same problem when using your code.
> > But I tried adding:
> > String item1 = cursor.getString(index1);
> > String item2 = cursor.getString(index2);
>
> > before while(cursor.moveToNext()){
> > as well as in it. And then it works fine. I guess it skips the first
> > post in cursor when I call moveToNext in while. And it probably did
> > the same in my old code.
>
> > //André
>
> > On Feb 10, 12:18 pm, Kostya Vasilyev  wrote:
> >> This for loop looks really strange:
>
> >> for(cursor.moveToFirst(); cursor.moveToNext(); cursor.isAfterLast())
>
> >> The condition for "isAfterLast" should be inverted.
>
> >> Also don't iterate twice and call getColumnIndex for each row, nether of 
> >> those is necessary. Something like this should work:
>
> >> cursor = ...
> >> if (cursor != null) {
> >> int index1 = cursor.getColumnIndex(...);
> >> int index2 = cursor.getColumnIndex(...);
>
> >> while (cursor.moveToNext()) {
> >> String item1 = cursor.getString(index1);
> >> String item2 = cursor.getString(index2);
> >> 
>
> >> }
> >> }
>
> >> Other than that, step through in the debugger, see what values you're
> >> storing and getting.
>
> >> Perhaps the top entry somehow has "time" set to NULL, so it doesn't sort
> >> properly. You can check this by changing your sort to be "_ID DESC" (the
> >> inverse of insertion order) and checking the time value you get back.
>
> >> -- Kostya
>
> >> 10.02.2011 13:54, André пишет:
>
> >>> I have a listview that gets it's posts from a database. I want the ten
> >>> latest entries sorted by the time they where added to the database.
> >>> This works, but it always skips the first post until a newer one is
> >>> added. What could I be doing wrong?
> >>> For this I use the following code:
> >>> public Cursor fetchAll() {
> >>>           Cursor mCursor = mDb.query(_TABLE, new String[] {_ROWID,
> >>> _NAME, _TEXT, _TIME}, null, null, null, null, _TIME + " DESC", "
> >>> 10");
> >>>           return mCursor;
> >>> }
> >>> Cursor cursor = db.fetchAll();
> >>> startManagingCursor(cursor);
> >>> ArrayList strings = new ArrayList();
> >>> for(cursor.moveToFirst(); cursor.moveToNext(); cursor.isAfterLast()) {
> >>>     String name = cursor.getString(cursor.getColumnIndex(db._NAME));
> >>>           strings.add(name);
> >>>    }
> >>>    String[] mNames = (String[]) strings.toArray(new
> >>> String[strings.size()]);
> >>>    ArrayList strings1 = new ArrayList();
> >>>     for(cursor.moveToFirst(); cursor.moveToNext();cursor.isAfterLast())
> >>> {
> >>>             String name =
> >>> cursor.getString(cursor.getColumnIndex(db._TEXT));
> >>>             strings1.add(name);
> >>>    }
> >>>    String[] mPath = (String[]) strings1.toArray(new
> >>> String[strings1.size()]);
> >>> // André
> >> --
> >> Kostya Vasilyev -- WiFi Manager + pretty widget 
> >> --http://kmansoft.wordpress.com
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget 
> --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Probelm with getting posts from database

2011-02-10 Thread André
Thanks Kostya,

I did as you suggested and it looks much better.
For my question though I got the same problem when using your code.
But I tried adding:
String item1 = cursor.getString(index1);
String item2 = cursor.getString(index2);

before while(cursor.moveToNext()){
as well as in it. And then it works fine. I guess it skips the first
post in cursor when I call moveToNext in while. And it probably did
the same in my old code.

//André

On Feb 10, 12:18 pm, Kostya Vasilyev  wrote:
> This for loop looks really strange:
>
> for(cursor.moveToFirst(); cursor.moveToNext(); cursor.isAfterLast())
>
> The condition for "isAfterLast" should be inverted.
>
> Also don't iterate twice and call getColumnIndex for each row, nether of 
> those is necessary. Something like this should work:
>
> cursor = ...
> if (cursor != null) {
> int index1 = cursor.getColumnIndex(...);
> int index2 = cursor.getColumnIndex(...);
>
> while (cursor.moveToNext()) {
> String item1 = cursor.getString(index1);
> String item2 = cursor.getString(index2);
> 
>
> }
> }
>
> Other than that, step through in the debugger, see what values you're
> storing and getting.
>
> Perhaps the top entry somehow has "time" set to NULL, so it doesn't sort
> properly. You can check this by changing your sort to be "_ID DESC" (the
> inverse of insertion order) and checking the time value you get back.
>
> -- Kostya
>
> 10.02.2011 13:54, André пишет:
>
>
>
>
>
>
>
>
>
> > I have a listview that gets it's posts from a database. I want the ten
> > latest entries sorted by the time they where added to the database.
> > This works, but it always skips the first post until a newer one is
> > added. What could I be doing wrong?
>
> > For this I use the following code:
>
> > public Cursor fetchAll() {
> >          Cursor mCursor = mDb.query(_TABLE, new String[] {_ROWID,
> > _NAME, _TEXT, _TIME}, null, null, null, null, _TIME + " DESC", "
> > 10");
> >          return mCursor;
> > }
>
> > Cursor cursor = db.fetchAll();
> > startManagingCursor(cursor);
>
> > ArrayList strings = new ArrayList();
> > for(cursor.moveToFirst(); cursor.moveToNext(); cursor.isAfterLast()) {
> >    String name = cursor.getString(cursor.getColumnIndex(db._NAME));
> >          strings.add(name);
> >   }
> >   String[] mNames = (String[]) strings.toArray(new
> > String[strings.size()]);
>
> >   ArrayList strings1 = new ArrayList();
> >    for(cursor.moveToFirst(); cursor.moveToNext();cursor.isAfterLast())
> > {
> >            String name =
> > cursor.getString(cursor.getColumnIndex(db._TEXT));
> >            strings1.add(name);
> >   }
> >   String[] mPath = (String[]) strings1.toArray(new
> > String[strings1.size()]);
>
> > // André
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget 
> --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Probelm with getting posts from database

2011-02-10 Thread André
I have a listview that gets it's posts from a database. I want the ten
latest entries sorted by the time they where added to the database.
This works, but it always skips the first post until a newer one is
added. What could I be doing wrong?

For this I use the following code:

public Cursor fetchAll() {
Cursor mCursor = mDb.query(_TABLE, new String[] {_ROWID,
_NAME, _TEXT, _TIME}, null, null, null, null, _TIME + " DESC", "
10");
return mCursor;
}

Cursor cursor = db.fetchAll();
startManagingCursor(cursor);

ArrayList strings = new ArrayList();
for(cursor.moveToFirst(); cursor.moveToNext(); cursor.isAfterLast()) {
String name = cursor.getString(cursor.getColumnIndex(db._NAME));
strings.add(name);
 }
 String[] mNames = (String[]) strings.toArray(new
String[strings.size()]);

 ArrayList strings1 = new ArrayList();
  for(cursor.moveToFirst(); cursor.moveToNext();cursor.isAfterLast())
{
String name =
cursor.getString(cursor.getColumnIndex(db._TEXT));
strings1.add(name);
 }
 String[] mPath = (String[]) strings1.toArray(new
String[strings1.size()]);

// André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Read files to edittext

2011-02-09 Thread André
Didn't think about stringbuilder when I did it. But I'll try it!

Does anyone else have any suggestions about size limitations?

//André

On Feb 9, 8:16 pm, Kostya Vasilyev  wrote:
> Can't speak for size limitations, but why are putting the data into a
> vector, and appending to EditText one line at a time?
>
> Reading line by line and building the content in a StringBuilder seems
> more efficient, then you can do editText.setText() just once.
>
> And reading one line at a time is only necessary if your file comes from
> Windows and contains '\r' characters (they are not recognized by
> TextView and have to be stripped, leaving just '\n'-s).
>
> -- Kostya
>
> 09.02.2011 21:20, André пишет:
>
>
>
>
>
>
>
>
>
> > What would be the best way of reading large text files from the
> > sdcard?
>
> > Right now I'm using this in my browser activity:
>
> > File f = new File(filePath);
> > FileInputStream file = new FileInputStream(f);
> > BufferedReader in = new BufferedReader(new InputStreamReader(file));
> > do {
> >    st = in.readLine();
> >    vector.add(st);
> > } while (st != null);
> > in.close();
>
> > and in the other activity where I want to edit the file I have:
>
> > char lf = 10;
> > int k = 0;
> > String s = null;
> > for (int i = 0; i<  browseractivity.vector.size(); i++) {
> >    s = browseractivity.vector.get(k);
> >    if (s != null) {
> >            editText.append(s);
> >            editText.append(String.valueOf(lf));
> >    }
> >    k++;
> > }
>
> > When trying this on a file of 24648 bytes which corresponds to 24097
> > chars on 555 lines
> > I looked in Notepad++ at which characters it cuts.
> > It displays 8764 characters which corresponds exactly to 9000 bytes
> > and 237 lines
>
> > Does any one have a better suggestion of how to do this so I can read
> > larger files?
>
> > //André
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget 
> --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Disable autosuggest/correct

2011-02-09 Thread André
They probably have! :)

Thanks for the help though!

On Feb 9, 7:57 pm, Kostya Vasilyev  wrote:
> On my Milestone the XML fragment I posted below only works for one of
> the two keyboards built into the firmware.
>
> Perhaps HTC also decided that users always want autocorrection? :)
>
> -- Kostya
>
> 09.02.2011 21:50, André пишет:
>
>
>
>
>
>
>
>
>
> > That doesn't work when I try it on my Desire. Could that be because
> > HTC has change their version of android a little?
>
> > // André
>
> > On Feb 9, 7:38 pm, Kostya Vasilyev  wrote:
> >> Umm, you call setInputType with flags according to this:
>
> >>http://developer.android.com/reference/android/text/InputType.html
>
> >> InputType.TYPE_CLASS_TEXT
> >>       | InputType.TYPE_TEXT_FLAG_MULTI_LINE
> >>       | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS
>
> >> seems about right.
>
> >> -- Kostya
>
> >> 09.02.2011 21:27, André пишет:
>
> >>> Thanks Kostya
> >>> How do I do that in java? Since I want it to be an option.
> >>> On Feb 9, 7:24 pm, Kostya Vasilyev    wrote:
> >>>> Andre,
> >>>> This works for me:
> >>>> android:inputType="text|textMultiLine|textNoSuggestions|textCapSentences"
> >>>> on a Motorola Milestone with the "Motorola Keyboard", but still gives
> >>>> suggestions with the "Mobidiv Keyboard".
> >>>> So it looks to be up to the IME to respect that flag, and if it ignores
> >>>> it, then well, it ignores it.
> >>>> -- Kostya
> >>>> 09.02.2011 20:54, André пишет:
> >>>>> I have an edittext where i want the user to have the choice to turn
> >>>>> off the autosuggest when typing. I tried to change the inputType but
> >>>>> it only changed the edittext to singel line edittext which I don't
> >>>>> want even when I included
> >>>>> android.text.InputType.TYPE_TEXT_FLAG_MULTI_LINE.
> >>>>> Any suggestions of how to do that?
> >>>>> //André
> >>>> --
> >>>> Kostya Vasilyev -- WiFi Manager + pretty widget 
> >>>> --http://kmansoft.wordpress.com
> >> --
> >> Kostya Vasilyev -- WiFi Manager + pretty widget 
> >> --http://kmansoft.wordpress.com
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget 
> --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Disable autosuggest/correct

2011-02-09 Thread André
That doesn't work when I try it on my Desire. Could that be because
HTC has change their version of android a little?

// André

On Feb 9, 7:38 pm, Kostya Vasilyev  wrote:
> Umm, you call setInputType with flags according to this:
>
> http://developer.android.com/reference/android/text/InputType.html
>
> InputType.TYPE_CLASS_TEXT
>      | InputType.TYPE_TEXT_FLAG_MULTI_LINE
>      | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS
>
> seems about right.
>
> -- Kostya
>
> 09.02.2011 21:27, André пишет:
>
>
>
>
>
>
>
>
>
> > Thanks Kostya
>
> > How do I do that in java? Since I want it to be an option.
>
> > On Feb 9, 7:24 pm, Kostya Vasilyev  wrote:
> >> Andre,
>
> >> This works for me:
>
> >> android:inputType="text|textMultiLine|textNoSuggestions|textCapSentences"
>
> >> on a Motorola Milestone with the "Motorola Keyboard", but still gives
> >> suggestions with the "Mobidiv Keyboard".
>
> >> So it looks to be up to the IME to respect that flag, and if it ignores
> >> it, then well, it ignores it.
>
> >> -- Kostya
>
> >> 09.02.2011 20:54, André пишет:
>
> >>> I have an edittext where i want the user to have the choice to turn
> >>> off the autosuggest when typing. I tried to change the inputType but
> >>> it only changed the edittext to singel line edittext which I don't
> >>> want even when I included
> >>> android.text.InputType.TYPE_TEXT_FLAG_MULTI_LINE.
> >>> Any suggestions of how to do that?
> >>> //André
> >> --
> >> Kostya Vasilyev -- WiFi Manager + pretty widget 
> >> --http://kmansoft.wordpress.com
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget 
> --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Disable autosuggest/correct

2011-02-09 Thread André
Thanks Kostya

How do I do that in java? Since I want it to be an option.

On Feb 9, 7:24 pm, Kostya Vasilyev  wrote:
> Andre,
>
> This works for me:
>
> android:inputType="text|textMultiLine|textNoSuggestions|textCapSentences"
>
> on a Motorola Milestone with the "Motorola Keyboard", but still gives
> suggestions with the "Mobidiv Keyboard".
>
> So it looks to be up to the IME to respect that flag, and if it ignores
> it, then well, it ignores it.
>
> -- Kostya
>
> 09.02.2011 20:54, André пишет:
>
> > I have an edittext where i want the user to have the choice to turn
> > off the autosuggest when typing. I tried to change the inputType but
> > it only changed the edittext to singel line edittext which I don't
> > want even when I included
> > android.text.InputType.TYPE_TEXT_FLAG_MULTI_LINE.
> > Any suggestions of how to do that?
>
> > //André
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget 
> --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Read files to edittext

2011-02-09 Thread André
What would be the best way of reading large text files from the
sdcard?

Right now I'm using this in my browser activity:

File f = new File(filePath);
FileInputStream file = new FileInputStream(f);
BufferedReader in = new BufferedReader(new InputStreamReader(file));
do {
st = in.readLine();
vector.add(st);
} while (st != null);
in.close();

and in the other activity where I want to edit the file I have:

char lf = 10;
int k = 0;
String s = null;
for (int i = 0; i < browseractivity.vector.size(); i++) {
s = browseractivity.vector.get(k);
if (s != null) {
editText.append(s);
editText.append(String.valueOf(lf));
}
k++;
}

When trying this on a file of 24648 bytes which corresponds to 24097
chars on 555 lines
I looked in Notepad++ at which characters it cuts.
It displays 8764 characters which corresponds exactly to 9000 bytes
and 237 lines

Does any one have a better suggestion of how to do this so I can read
larger files?

//André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Disable autosuggest/correct

2011-02-09 Thread André
I have an edittext where i want the user to have the choice to turn
off the autosuggest when typing. I tried to change the inputType but
it only changed the edittext to singel line edittext which I don't
want even when I included
android.text.InputType.TYPE_TEXT_FLAG_MULTI_LINE.
Any suggestions of how to do that?

//André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] database values to string[]

2011-01-29 Thread André
Is there a simple way to get all my values from a column in my
database to a String[] without having to use simpleCursorAdapter?

When I try:

String[] from = new String[]{dbManager.NAME};

I only get the name of the column.
I'd appreciate any suggestions!

//André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: SQL query

2011-01-29 Thread André
Thanks, did as you said and found a mistake I made. It works perfectly
now!

On Jan 29, 4:14 pm, Kostya Vasilyev  wrote:
> Your query looks ok to me.
>
> Check how you insert data, and make sure that the value that's stored in
> the database is what you expect.
>
> Oh, and before you call "recentC.getLong(recentC.getColumnIndexOrThrow",
> make sure you've moved the cursor to the first row.
>
> -- Kostya
>
> 29.01.2011 18:02, André пишет:
>
>
>
>
>
>
>
>
>
> > Thanks for quick answers guys!
>
> > It works very well with getCount(). Do you have any suggestions about
> > the query thou? Because it still returns 0 on get count when I try to
> > look for the already existing entry.
>
> > mCursor = mDb.query(true, RECENT_TABLE, new String[] {RECENT_ROWID,
> > RECENT_NAME, RECENT_FILE, RECENT_TIME}, RECENT_FILE + " = ?", new
> > String[]{file},  null, null, null, null);
>
> > Any suggestions there?
>
> > On Jan 29, 3:50 pm, kernelpanic  wrote:
> >> I just went through this myself, but my logic is inverted to yours, so
> >> ignore my previous
>
> >> probably better to use
>
> >> if (recentC.getCount() != 0) {
>
> >> On Jan 29, 8:41 am, André  wrote:
>
> >>> This is doing my head in.
> >>> I have a database where there is currently one entry. What I want to
> >>> do is to check if this entry exists. If it does I want to update it,
> >>> if not create a new one.
> >>> recentC = db.fetchExisting(file);
> >>> if (recentC != null){
> >>>          long rwId =
> >>> recentC.getLong(recentC.getColumnIndexOrThrow(SilverDbManager.RECENT_ROWID)
> >>>  );
> >>>          db.updateRecent(rwId, name, file, time);} else {
> >>>          db.createRecent(name, file, time);
> >>> }
> >>> public Cursor fetchExisting(String file) throws SQLException {
> >>>          Cursor mCursor = null;
> >>>          mCursor = mDb.query(true, RECENT_TABLE, new String[]
> >>> {RECENT_ROWID, RECENT_NAME, RECENT_FILE, RECENT_TIME}, RECENT_FILE + "
> >>> = ?", new String[]{file},  null, null, null, null);
> >>>          return mCursor;
> >>> }
> >>> I know that recentC != null is probably wrong but I dont know what to
> >>> change it to. And its some problem with the query because it can't
> >>> find the entry I already have there when I search for it.
> >>> Any suggestions?
> >>> //André
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget 
> --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: SQL query

2011-01-29 Thread André
Thanks for quick answers guys!

It works very well with getCount(). Do you have any suggestions about
the query thou? Because it still returns 0 on get count when I try to
look for the already existing entry.

mCursor = mDb.query(true, RECENT_TABLE, new String[] {RECENT_ROWID,
RECENT_NAME, RECENT_FILE, RECENT_TIME}, RECENT_FILE + " = ?", new
String[]{file},  null, null, null, null);

Any suggestions there?

On Jan 29, 3:50 pm, kernelpanic  wrote:
> I just went through this myself, but my logic is inverted to yours, so
> ignore my previous
>
> probably better to use
>
> if (recentC.getCount() != 0) {
>
> On Jan 29, 8:41 am, André  wrote:
>
>
>
>
>
>
>
> > This is doing my head in.
> > I have a database where there is currently one entry. What I want to
> > do is to check if this entry exists. If it does I want to update it,
> > if not create a new one.
>
> > recentC = db.fetchExisting(file);
> > if (recentC != null){
> >         long rwId =
> > recentC.getLong(recentC.getColumnIndexOrThrow(SilverDbManager.RECENT_ROWID) 
> > );
> >         db.updateRecent(rwId, name, file, time);} else {
>
> >         db.createRecent(name, file, time);
>
> > }
>
> > public Cursor fetchExisting(String file) throws SQLException {
> >         Cursor mCursor = null;
> >         mCursor = mDb.query(true, RECENT_TABLE, new String[]
> > {RECENT_ROWID, RECENT_NAME, RECENT_FILE, RECENT_TIME}, RECENT_FILE + "
> > = ?", new String[]{file},  null, null, null, null);
> >         return mCursor;
>
> > }
>
> > I know that recentC != null is probably wrong but I dont know what to
> > change it to. And its some problem with the query because it can't
> > find the entry I already have there when I search for it.
>
> > Any suggestions?
>
> > //André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] SQL query

2011-01-29 Thread André
This is doing my head in.
I have a database where there is currently one entry. What I want to
do is to check if this entry exists. If it does I want to update it,
if not create a new one.

recentC = db.fetchExisting(file);
if (recentC != null){
long rwId =
recentC.getLong(recentC.getColumnIndexOrThrow(SilverDbManager.RECENT_ROWID));
db.updateRecent(rwId, name, file, time);
} else {
db.createRecent(name, file, time);
}


public Cursor fetchExisting(String file) throws SQLException {
Cursor mCursor = null;
mCursor = mDb.query(true, RECENT_TABLE, new String[]
{RECENT_ROWID, RECENT_NAME, RECENT_FILE, RECENT_TIME}, RECENT_FILE + "
= ?", new String[]{file},  null, null, null, null);
return mCursor;
}

I know that recentC != null is probably wrong but I dont know what to
change it to. And its some problem with the query because it can't
find the entry I already have there when I search for it.

Any suggestions?

//André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Edittext max characters - not set max

2011-01-26 Thread André
Thanks Hari that was what I was looking for.

The same goes for strings right? So what ever size could be put in a
string can be put in a edittext?
Or should I use string[] for that instead of a normal string?



On Jan 26, 8:05 pm, Hari Edo  wrote:
> I think Andre was looking for a design limit, not how to set one.
>
> The control can handle many pages of text, even with spanning styled
> markup.  The EULA which I saw on one Android tablet was shown in a
> simple text view, and it was about fifty pages of text on the tablet.
> (The EditText control should have the same limits as the TextView,
> as the EditText is just some additional features on the basic view.)
>
> The answer is "how much memory can you allocate?"  Of course
> the system needs to allocate resources to measure and typeset and
> render all of that text.  If it's too long, consider showing the text
> in pages or chunks.
>
> On Jan 26, 1:05 pm, Marcin Orlowski  wrote:
>
>
>
>
>
>
>
> > On 26 January 2011 18:27, André  wrote:
>
> > > Is there a limit on how many characters and or lines you can have in
> > > an edittext? Or is it unlimited?
>
> >http://developer.android.com/reference/android/widget/TextView.html#a...

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Edittext max characters - not set max

2011-01-26 Thread André
Is there a limit on how many characters and or lines you can have in
an edittext? Or is it unlimited?

//André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Get my SIM Phone Number

2011-01-23 Thread André Barbosa
Is any way to get the SIM phone number without use
TelephonyManager.getLine1Number()?

I tried use :
TelephonyManager tMgr
=(TelephonyManager)mAppContext.getSystemService(Context.TELEPHONY_SERVICE);
  mPhoneNumber = tMgr.getLine1Number();

but don't work with my SIM Card. Anybody know other method to get the
SIM phone number without use the rild to get this information?

Best Regards,
André Barbosa.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Httpclient with Nexus S

2011-01-13 Thread André Charles Legendre
Hi

I avec a connection problem with httpClient specificaly in Nexus one

I have this line of coe working on any Android devices  but in NexusS it
works only in 3G

String res = getHttpClient().execute(mHttpPost, new BasicResponseHandler());

Any idea welcome

Andre

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: app2sd - not working

2011-01-05 Thread André
So what could be the problem if I have minsdkversion 4 and put
targetversion 8

On Jan 5, 12:59 pm, Marcin Orlowski  wrote:
>
> Yes it would filter your app out. android:installLocation does not
> need target sdk to be 8
> or higher. It's safe to have it in Manifest and still target earlier sdk as
> earlier android version will simply ignore it.

So what could be the problem then since it doesn't work, if you have
any suggestions?


YuviDroid Jan 5, 12:58 pm
>I was talking about "targetSdkVersion", not "minSdkVersion".
>AThe entry in the manifest should look like this: android:minSdkVersion="4" android:targetSdkVersion="8" />
>Btw on your test phone can you install your app on sdcard?

I have a 1.6 device, waiting for a new one right now. But it works
fine in the emulator!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: app2sd - not working

2011-01-05 Thread André
I followed this tutorial:
http://mobile.tutsplus.com/tutorials/android/move-to-sd-card/
where it says that I don't need to have 8 as the minsdkversion.
Doesn't it filter the app so only people with version 8 or greater can
download my app?


On Jan 5, 12:02 pm, YuviDroid  wrote:
> Just a guess:
> the problem might be here: 
>
> you should probably also specify the targetSdkVersion to be >= 8.
>
> Again, it's just a guess ;)
>
>
>
>
>
>
>
>
>
> On Wed, Jan 5, 2011 at 11:51 AM, André  wrote:
> > I've just updated my app so the user can choose to install it on the
> > sd card or not. But I keep getting some comments that it's not
> > possible for them to install it on the sd card. Can anyone see if I've
> > made anything wrong or if you have any other suggestions?
>
> > André
>
> > 
> > http://schemas.android.com/apk/res/android";
> >        package="com.someapp.fun"
> >        android:versionCode="1"
> >        android:versionName="3.0"
> >        android:installLocation="auto" >
>
> >        
> >         > android:name="android.permission.ACCESS_NETWORK_STATE" />
> >         > android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
> >         > /
>
> >        
>
> >        
>
> >    
>
> >        ...
>
> >    
> > 
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com > cr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> YuviDroid
> Check out Launch-X <http://android.yuvalsharon.net/launchx.php> (a widget to
> quickly access your favorite apps and contacts!)http://android.yuvalsharon.net

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] app2sd - not working

2011-01-05 Thread André
I've just updated my app so the user can choose to install it on the
sd card or not. But I keep getting some comments that it's not
possible for them to install it on the sd card. Can anyone see if I've
made anything wrong or if you have any other suggestions?

André


http://schemas.android.com/apk/res/android";
package="com.someapp.fun"
android:versionCode="1"
android:versionName="3.0"
android:installLocation="auto" >











...




-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: onDestroy() and finish()

2010-12-21 Thread André
Thanks guys. This was good to know!

On Dec 21, 4:26 pm, Kostya Vasilyev  wrote:
> 21.12.2010 18:12, Leon Moreyn-Android Development пишет:
>
> > If you want to verify in theory that you app has shut down put a log
> > into the onDestroy() and have it log that the processes are all
> > terminated.
>
> That's actually not the same.
>
> Even with all application's activities and services terminated, Android
> may still keep the process in memory in a dormant state until it's
> kicked out when memory gets low.
>
> I'd recommend anyone that they stop worrying about process lifecycles,
> and focus on framework-level components and their lifecycles instead
> (activities, services, etc., ensuring proper cleanup of resources and
> state management).
>
> --
> Kostya Vasilyev -- WiFi Manager + pretty widget 
> --http://kmansoft.wordpress.com

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] onDestroy() and finish()

2010-12-21 Thread André
I was using just this.finish(); in my app when exiting my app. But
using ESTaskManager after closing my app I found that it's still
running in the background. So I moved this.finish(); inside onDestroy.
But program is still running. What am I doing wrong? I want it to
fully close when it's closed.

André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Edittext singleline in landscape

2010-12-16 Thread André
Hi,

How can I disable the singleline thing in Edittext when editing in
landscape mode?
I have tried android:singleLine="false" in the xml file and it doesn't
work.
Any suggestions?

André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Scrollview

2010-12-16 Thread André
Hi,

I am trying to make an edittext with line numbers. For this I have one
edittext and to the left of it is a textview with the line numbering.
I have tried to put both of these in a scrollview so that both of them
can be scrolled simultaneously. But when the edittext is focused it
can still scroll by it self so that the line numbers doesn't match.
Is there a way to disable scrolling in a edittext? Or does anyone have
any other suggestions how to solve this?

André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Streaming mp3 file with RTSP protocol

2010-12-05 Thread André Barbosa
hi all,
I am trying play a mp3 stream file using rtsp protocol. To do this i
am using the DarwinStreamingSrvr as a RTSP server and mediaplayer to
play the RTSP link.
I already tried play the mp4 video file and i didn't had any problems.
However, when i try play the mp3 file i don't have sucess and i get
the error:


V/AudioStreamPlayer(10476): playRTSPAudioURL :: IN
I/QC_CORE ( 3013): OMXCORE API - OMX_Init
I/QC_CORE ( 3013): OMXCORE API - OMX_ComponentNameEnum 159d0 128 0
I/QC_CORE ( 3013): GetRolesOfComponent OMX.qcom.video.decoder.avc
I/QC_CORE ( 3013): GetRolesOfComponent OMX.qcom.video.decoder.avc
I/QC_CORE ( 3013): OMXCORE API - OMX_ComponentNameEnum 159d0 128 1
I/QC_CORE ( 3013): GetRolesOfComponent OMX.qcom.video.decoder.mpeg4
I/QC_CORE ( 3013): GetRolesOfComponent OMX.qcom.video.decoder.mpeg4
I/QC_CORE ( 3013): OMXCORE API - OMX_ComponentNameEnum 159d0 128 2
I/QC_CORE ( 3013): GetRolesOfComponent OMX.qcom.video.decoder.h263
I/QC_CORE ( 3013): GetRolesOfComponent OMX.qcom.video.decoder.h263
I/QC_CORE ( 3013): OMXCORE API - OMX_ComponentNameEnum 159d0 128 3
I/QC_CORE ( 3013): GetRolesOfComponent OMX.qcom.video.encoder.mpeg4
I/QC_CORE ( 3013): GetRolesOfComponent OMX.qcom.video.encoder.mpeg4
I/QC_CORE ( 3013): OMXCORE API - OMX_ComponentNameEnum 159d0 128 4
I/QC_CORE ( 3013): GetRolesOfComponent OMX.qcom.video.encoder.h263
I/QC_CORE ( 3013): GetRolesOfComponent OMX.qcom.video.encoder.h263
I/QC_CORE ( 3013): OMXCORE API - OMX_ComponentNameEnum 159d0 128 5
E/MediaPlayer(10476): start called in state 4
E/MediaPlayer(10476): error (-38, 0)
V/AudioStreamPlayer(10476): playRTSPAudioURL :: media player started!
E/MediaPlayer(10476): Error (-38,0)
I/ActivityManager( 3019): Displayed activity
com.MediaFrameWork/.AudioStreamPlayer: 710 ms (total 710 ms)


Somebody help me? I already saw the media formats supported and
OpenCore have mp3 codec.
Best regards.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] New view for MediaController

2010-11-18 Thread André Barbosa
Hi all,
i want alter the MediaController layout. I created
MediaControllerAdapter class what extends MediaController for i can do
some changes in layout of the MediaController. I already tried add a
new View but the android doesn't show the view. So I need the
MediaController layout in xml to do some modifications. I already
tried search the R file in android source code, but i don't have
success.

Somebody can give me some help? I tried to find some method to modify
the View object, but i don't know how i do this...

Best Regards,
André Barbosa.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Video Calls on Android using Sipdroid

2010-10-30 Thread André Barbosa
Hi,
since release the SipDroid 1.5, I search how it is possible the
SipDroid do this. I already searched the Sipdroid page and I don't saw
any official information about this feature. However, some people told
that SIPDroid use the Android rtsp feature to play the video stream.

I already tried put the SIPDroid video call work on two Nexus One, two
HTC Desire, one HTC Hero, one HTC Magic and one HTC G1 with TrixBox
server and never work!

Someone get this working? Someone can clarify me how video calls work
in SIPDroid? I think this is very interesting for all people that
working with media on Android.

Best Regards,
André Barbosa.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] problem with AsyncTask

2010-09-10 Thread André
Hi,
I was wondering if someone could help me with my asynctask? I have a
problem with onPostExecute and onCancelled. onPostExecute seems to be
skipped everytime I run the asynctask, the file downloads, no problem,
but the dialog is still there. As for the cancel button, it doesn't
seem to reach onCancelled. Can anyone wee what I'm doing wrong?

/André

protected class DownloadTask extends AsyncTask{

private Dialog dialogD;
private ProgressBar downloadBar;
private ImageButton cancel;

OnClickListener listen = new OnClickListener() {
@Override
public void onClick(View v) {
if(v == cancel) {
downloadTask.cancel(true);
}
}
};

@Override
protected void onPreExecute() {
super.onPreExecute();
//  Context mContext = getApplicationContext();
dialogD = new Dialog(SilverFTP.this);
dialogD.setContentView(R.layout.silver_ftp_downloading);
dialogD.setTitle("Downloading...");
TextView info = (TextView)
dialogD.findViewById(R.id.download_info);
info.setText(fileName);
downloadBar = (ProgressBar)
dialogD.findViewById(R.id.download_bar);
cancel = (ImageButton) 
dialogD.findViewById(R.id.cancel_download);
cancel.setOnClickListener((OnClickListener) this);
dialogD.show();
logg.append("onPreExecute" + "\n");
Log.i("makemachine", "onPreExecute()");
}

@Override
protected Void doInBackground(final Context... params) {
try {
InputStream stO = new
BufferedInputStream(client.retrieveFileStream(fileToUse),
client.getBufferSize());
OutputStream stD = new FileOutputStream(placeToPaste);
while (ftpTotal < ftpSize) {
Util.copyStream(stO, stD, client.getBufferSize(),
CopyStreamEvent.UNKNOWN_STREAM_SIZE, new CopyStreamAdapter(){
public void bytesTransferred(long
totalBytesTransferred, int bytesTransferred, long streamSize) {
double tempProgress =
(((double)totalBytesTransferred / (double)ftpSize) * 100.0);
int progress = (int) tempProgress;
publishProgress(progress);
}
});
}
client.completePendingCommand();
} catch (IOException e) {
logg.append("Download IOExc, download()" + 
"\n");
e.printStackTrace();
}
return null;
}

protected void onProgressUpdate(final Integer... values) {
downloadBar.setProgress(values[0]);
Log.i("makemachine", "onProgressUpdate(): " +
String.valueOf(values[0]));
}

@Override
protected void onCancelled() {
super.onCancelled();
downloadTask.dialogD.dismiss();
}

@Override
protected void onPostExecute(Void v) {
logg.append("onPostExecute" + "\n");
downloadTask.dialogD.dismiss();

}

}

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Update progressbar in custom dialog

2010-08-20 Thread André
Hi,

is it possible to have a progressbar that is updated in realtime in a
custom dialog?
If so, how do I make it work?
At the moment I have made a custom dialog with onCreateDialog() and
onPrepareDialog() with a progressbar. I am using AsyncTask to update
the progressbar in the onProgressUpdate. This worked fine when the
progressbar was not in a dialog.
Where it force closes is when the line downloadBar is executed:

protected void onProgressUpdate(final Integer... values) {
downloadBar.setProgress(values[0]);
Log.i("makemachine", "onProgressUpdate(): " +
String.valueOf(values[0]));
}

Happy for any answers.
Thanks
André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Hide context menu

2010-07-31 Thread André
Thanks for a quick answer! Sorry for slow reply!

Nice word, I'll try it!

On Jul 26, 3:25 pm, TreKing  wrote:
> On Mon, Jul 26, 2010 at 8:21 AM, André  wrote:
> > Does anyone have an idea how to solve this problem?
>
> One word: AsyncTask.
>
> --- 
> --
> TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] AppBrain: Programmatic download & install of Market apps

2010-07-28 Thread André
Hi,

Most of you might know AppBrain already. It has a great feature to
install apps on your phone directly from their web site which works on
nearly all android phones (with version 1.5 Cupcake or later). I'd
like to resemble that kind of web install of Market apps in my own
product.

>From what I've found out so far the AppBrain Fast Web Install requires
the "Android Services" permission
(com.google.android.providers.gsf.permission.READ_GSERVICES). However,
I didn't find much details about this permission yet or what you
actually could do with it. But obviously this seems to do the trick of
installing applications on the phone without requiring any user input
(e.g. manually selecting "download" etc. like when using the "market://
details?..." type of intent).

I wonder how this might work in detail and would greatly appreciate
any hint on this topic.

-- André
http://android.rabold.org

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Hide context menu

2010-07-26 Thread André
Hello,
I have a context menu that starts to do some calculations when you
press one of the context menu items. Like this:

case 0: {
...
...
calculations();
...
...
return true;}

While the calculations are made I have a progressbar that I want to
show. The progressbar is called from the calculations() method. The
problem is that I can only see the context menu while the calculations
are being made and the phone is more or less frozen.

Does anyone have an idea how to solve this problem?

/André

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


  1   2   3   >