Skip to main content

Posts

Showing posts from February 29, 2012

CGContextSetShadowWithColor not working

This code should be showing a shadow, but it isn't: CGContextRef context = UIGraphicsGetCurrentContext(); //Border CGMutablePathRef outerPath = createRoundedRectForRect(self.bounds, MENU_BUTTON_OUTER_RADIUS); CGContextSetFillColorWithColor(context, [[UIColor colorWithWhite:0 alpha:0.18] CGColor]); CGContextAddPath(context, outerPath); CGContextFillPath(context); //Button UIColor *buttonColor; if (self.type == JMenuButtonTypeBlack) { buttonColor = [UIColor colorWithWhite:0 alpha:1.0]; } else if (self.type == JMenuButtonTypeWhite) { buttonColor = [UIColor colorWithWhite:0.72 alpha:1.0]; } CGRect insideRect = rectForRectWithInset(self.bounds, 3); CGMutablePathRef innerPath = createRoundedRectForRect(insideRect, MENU_BUTTON_INNER_RADIUS); CGPoint gradientTop = CGPointMake(0, insideRect.origin.y); CGPoint gradientBottom = CGPointMake(0, insideRect.origin.y + insideRect.size.height); //Base color CGContextSaveGState(context); CGContextSetFillColorWithColor(context, [buttonColor

insertSubview:belowSubview: in UITableViews

I have a UITableView with UITableViewCell s that are swipable. When a cell is swiped, I want a view to be visible (revealed) underneath that cell. Here's the code that I have: UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath]; _cellBack = [[UIView alloc] initWithFrame:CGRectMake(0, cell.frame.origin.y, cell.frame.size.width, cell.frame.size.height)]; _cellBack.backgroundColor = [UIColor whiteColor]; [self.tableView insertSubview:_cellBack belowSubview:cell]; for (int i = 0; i < [self.tableView subviews].count; i++) { UIView *v = [[self.tableView subviews] objectAtIndex:i]; if ([v isEqual:_cellBack]) { NSLog(@"cellBack %d", i); } if ([v isEqual:cell]) { NSLog(@"cell %d", i); } } In the for loop, I check to see if the views' indexes are as I expect, and indeed they are; _cellBack has an index that is one less than cell 's index. When I replace the insertSubview:belowSubview: call wit

dose setHTTPBody need an encoding type

dose setHTTPBody need an encoding type if you are passing it a NSMutable data type though a NSData in the method parameter? Basically I have a method which creates my http body packet along the lines of this - (void) constructRequest { //Create final packet NSMutableData * myConstructedMutableDataPacket = [[NSMutableData alloc] init]; [myConstructedMutableDataPacket appendData:Sig]; [myConstructedMutableDataPacket appendData:Ver]; //etc //call connection method [self [self VehicleSearchRequest:myConstructedMutableDataPacket]; } ]; } then in the connection method is where i declare all my request stuff. Also I am passing the NSMutableData object myConstructedMutableDataPacket over to the NSData parameter of my connection class as listed below. - (IBAction)VehicleSearchRequest:(NSData *)postBodyData { //all my connection crap NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:60.0

Problems in storing data in a H5 file?

double val = 18.5; ByteArrayOutputStream bytestream = new ByteArrayOutputStream(); DataOutputStream datastream = new DataOutputStream(bytestream); datastream.writeDouble(val); datastream.flush(); datastream.close(); bytestream.close(); byte[] bytes = bytestream.toByteArray(); for (int j = 0; j < bytes.length; j++) { write_data[indx] = bytes[j]; indx++; H5.H5Dwrite(dataset_id, memtype_id, HDF5Constants.H5S_ALL, HDF5Constants.H5S_ALL, HDF5Constants.H5P_DEFAULT,write_data); After the data is created and written into the file, when the user tries to open and read the data in HDF view, instead of 18.9, it shows 1.3456789345E45

Preloading a large image

I have an image with the dimensions of 5534 × 3803, and size of 2.4mb. The UIView references notes that: "In iOS 3.0 and later, views are no longer restricted to this maximum size but are still limited by the amount of memory they consume." When the image loads, it lags for half a second, then slides in. The image sits in the UIImageView at 1024x704, but can be scaled up to 4x that size for the purpose of my app. Are you able to preload the image in the AppDelegate? Or is there another way of working around having such a large image? Thanks EDIT: The scaling is done via UIPinchGestureRecognizer, and scales up and done (scale x4 - x1) based on the image's center point. There is no panning of the image when zoomed in.

How to replace the string values stored with in a variable in objective c

I got an xml in output for the webservices.I have the result in the variable and i stored the result in that variable.Now i want to replace the strings in that variable.How to replace the strings in that variable. For ex: //SDZZmaterialGroupList* result = (SDZZmaterialGroupList*)value; in that result variable i stored the result is: </Text></item> <item> <Matkl>00101</Matkl> <Text>Steels</Text> </item> <item> <Matkl>00107</Matkl> <Text>Miscelleanous</Text> </item> <item> <Matkl>002</Matkl> <Text>Electronics</Text> </item> <item> <Matkl>00207</Matkl> <Text>Monitors</Text> </item> <item> <Matkl>003</Matkl> <Text>Bulbs</Text> </item> <item> <Matkl>007</Matkl> <Text>Services</Text> </item> <item> <Matk

Y axis positioning

I have added extra y axis in the graph. When i am trying to display the graph the added Y axis is not visible. I am able to draw graph with that y axis. How can i make that Y axis visible? My code is as below.. CPTXYAxis *rightY = [[CPTXYAxis alloc] init]; rightY.coordinate = CPTCoordinateY; rightY.orthogonalCoordinateDecimal = CPTDecimalFromFloat(3600 * 7); //rightY.majorGridLineStyle = lineStyle; rightY.axisLineStyle = lineStyle2; [rightY setAxisTitle:[[CPTAxisTitle alloc] initWithText:@"New Axis" textStyle:whiteText]]; rightY.gridLinesRange = [[CPTPlotRange alloc] initWithLocation:CPTDecimalFromInt(0) length:CPTDecimalFromInt(15)]; rightY.plotSpace = plotSpace1; NSMutableArray *newAxes = [graph.axisSet.axes mutableCopy]; [newAxes addObject:rightY]; graph.axisSet.axes = newAxes; [newAxes release]; [graph addPlotSpace:plotSpace1];

Works fine for the first time, next time getting DB locked issue

Please find the below function.it works fine for the first time. I mean , when i add a text it works for the first time , then when i try to add a new text again , it give me like "DB is locked". I am not sure how it works for the first not again? Please let me know what is the problem in my code. //================================================================== - ( BOOL ) addNewSimpleTemplates:(NSString*)dbPath:(NSString*)title{ //================================================================== BOOL returnVal = NO; NSString *maxValuePosition; if (sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK) { NSString *selectSQL = [NSString stringWithFormat:@"select MAX(pr.position) FROM phrase_reference pr inner join storyboard_main_categories smc on smc.id = pr.main_category_id where smc.category_name = %@", @"'Simple Templates'"]; const char *sql = [selectSQL UTF8String]; sqlite3_stmt *selectStmt; if(sqlite

Xcode 4.2.1 issue : Universal app runs on iPad but not on iphone

I am right now working on one universal application where I am stuck to one point. I was able to successfully launch my application both on iPhone and iPad but since 2-3 days, I am not able to launch my application on neither iPhone nor iPhone simulator but it runs smoothly on iPad/ipad simulator. Also when I run my app choosing iPhone device it shows message like Running the App on iPhone simulator but i am not able to see any effect on my simulator. I am using Xcode 4.2.1 and I guess the issue is pertains to the same. Kindly help me out to resolve the issue. Thank you.

iPhone: Sqlite update or insert row

I want to update the quantity if the menuid is already available otherwise add a new row. I used the following code.But no row is added or updated. sqlite3 *database; sqlite3_stmt *addStmt=nil; if (selection== nil) { selection =@"Medium"; } if (sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK) { const char *select="select quantity from item where menuid = ?"; sqlite3_stmt *selectstmt; if(sqlite3_prepare_v2(database, select, -1, &selectstmt, NULL) == SQLITE_OK) { while(sqlite3_step(selectstmt) == SQLITE_ROW) { menuID= [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt, 0)]; char *quant = (char *)sqlite3_column_text(selectstmt,1); quantity=[NSString stringWithUTF8String:(char *)quant]; // [self.ids addObject:menuID]; } sqlite3_reset(selectstmt);

Read plist from URL into NSMutableDictionary

I am trying to do read a PLIST from URL to a NSMutableDictionary. Code before autos = [[NSMutableArray alloc] init]; [autos addObject:[[NSMutableDictionary alloc]initWithObjectsAndKeys:@"Auto 1", @"name", @"Auto.png", @"image", @"Klassiker", @"description" , nil]]; This works. But now I want to use a PLIST. And I am trying this, this way: autos = [[NSMutableArray alloc]initWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://dl.dropbox.com/u/9358444/auto.plist"]]]; Thanks. PLIST http://dl.dropbox.com/u/9358444/auto.plist

InApp purchase doubts [closed]

I am doing a book reder application in iphone The data is in sqlite,there are five books. There are five UIButtons with button title as book name. For e.g., book1, book2, book3, book4 .... If the user wants to read the above books, he should do a payment in iTunes using InApp Payments. If the payment is correctly done for that particular book, it need the corresponding button to enable for click action, in default it is disabled. Is this possible to do a payment only in inapp and get a payment id. is there any other way for doing the same?

Programmatically Position items in activity. NO XML

I have an Activity that has all the display elements added dynamically. Theres no xml for the acvtivity at all. The Activity consists of the following controls: RelativeLayout (Layout object that all the child views sit in) TextView (Title for the page, sits at top of the RelativeLayout) ScrollView (Scrollable area that holds all the data controls) LinearLayout (Layout object to hold the activity buttons) I want to know how it is possible to define that the ScrollView sits below the Title TextView and above the LinearLayout button holder where the LinearLayout is set to the Activity Page bottom I have tried using RelativeLayout.LayoutParams to set up rules but cannot seem to understand the way to do it. Any help or links to tutorials would be apreciated I have included my Code to see if someone can help // declare the items for display RelativeLayout baseLayout = new RelativeLayout(this); // add the customer name and number field. // NOTE: We wil

android market says no device compatible?

I have developed my own app in android version 8(2.2) and published it in android market. When i tried to install it in my Samsung Galaxy pop (2.2.1) device from market. No compatible device is found. this message appears though i have specified <supports-screens android:largeScreens="true" android:smallScreens="true" android:normalScreens="true" android:anyDensity="true" /> <uses-sdk android:minSdkVersion="8" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.CAMERA"/> <uses-permission android:name="android.permission.WRITE_EXTER

Page contains error in android phonegap wit h jquery mobile. Please help me i m in real need

I have deployed android application made with phone gap, and I haven't problem with emulator and web browser.But when i install that application on android tablet (samsung galaxy) device it shows following error when i click on cell of table. Application Error: The web page contains an error. (file:///android_asset/www/tips_list.html?act=SET_TIPS_LIST&cid=1) In my application I am displaying list of categories in table and when user click on any cell of table it will navigate to its subcategory page. It works fine in emulator but crashes in tablet.

How to detect particular UIImageView for UITouch Events

I've added 5 UIImageView dynamically and filled it with different images, what I am trying to do is "Allow user to set position for any UIImageView", for that I used -(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { //Here I want the object of particular UIImageView on which user touched. } NSLog(@"%@",[touches anyObject]); //It returns output like below, /*<UITouch: 0x68b95e0> phase: Began tap count: 1 window: <UIWindow: 0x68875d0; frame = (0 0; 320 480); layer = <UIWindowLayer: 0x68b6470>> view: <UIImageView: 0x6a74cf0; frame = (83.7763 83.7763; 182.447 182.447); transform = [0.968912, -0.247404, 0.247404, 0.968912, 0, 0]; alpha = 0.8; opaque = NO; tag = 3; layer = <CALayer: 0x6a74980>> location in window: {161, 230} previous location in window: {161, 230} location in view: {52.7761, 105.448} previous location in view: {52.7761, 105.448}*/ //Note, in above output, it showing my UIImageView object on which I touc

Video compression changes custom tab bar in iOS 5

I have implemented a custom tabbar in my app. Where I can scroll on the tab, and also the tab can have more than 5 buttons. The problem is when i pick a video with imagepickercontroller, the compressing video dialog box shows up. The video is compressed and when the imagepicker is dismissed, my custom tabBar gets distorted. The default tabbar shows at the bottom of the screen along with my custom tabbar. And this problem is only when i run the app on iOS 5 device. Please help me out here, either tell me how to avoid compression (tried setting the video quality to 'HIGH'), or some way around the compression thing.

Google Analytics unique purchases suddenly stopped working

For some reason reporting of unique purchases has stopped working in google analytics for the past few days. It has been working for over 6 months without a flaw, but all of a sudden (it seems since the last iphone app update) it has stopped recording unique purchases. I didn't modify anything related to the GA code since the last iphone release. I am viewing the unique purchases using the "Custom Reporting" in google analytics, using the "Unique Purchases" metric, and "Day" dimension. The analytics calls are integrated from an iphone app, and I make the ecommerce calls addTransaction , addItem and trackTransactions - and they all return without a error when i debug through the iphone simulator. I am following this document as reference: http://code.google.com/apis/analytics/docs/mobile/ios.html Im not doing anything different to what the docos are saying. Any assistance as to how i can figure out what is going wrong would be greatly app

Linearlayout gravity issue?

İ have problem about linear layout. i think something is weard.All of them same layout but back button moving related icon buton.I want to fit back button on the left side and btn_header_what_search_user button want to right site.But they are moving related icon(center icon).Why? and how can i back button on the left side. my code:` <LinearLayout android:layout_height="44dip" android:layout_width="320dip" android:background="@drawable/header_320_44dip"> <ImageView android:layout_width="121dip" android:layout_height="32dip" android:layout_gravity="center" android:layout_marginLeft="90dip" android:background="@drawable/icon"> </ImageView> <ImageView android:layout_width="52dip" android:layout_height="32dip" android:layout_gravity

play video with qcar and android AR application

I am developing an android application in which a specific video is played when the poster of a specific movie is shown infront of the camera in android, i found many AR tutorial just show 3D object when detect a pattern, i need some advice to make application that can play video with AR application using android camera and qcar SDK

How to put image in HashMap by giving a specific url

private static final String picpic = "picpic"; private ArrayList < HashMap < String, Object>> myBooks; myBooks = new ArrayList<HashMap<String,Object>>(); HashMap < String, Object> hm; hm = new HashMap<String, Object>(); drawable=LoadImage("http://www.wauhaha.com/smart/company/album/pic.jpg"); hm.put(picpic, drawable); myBooks.add(hm); final ListView listView = (ListView)findViewById(R.id.list); SimpleAdapter adapter = new SimpleAdapter(this, myBooks, R.layout.listbox, new String[]{picpic}, new int[]{R.id.image1}); listView.setAdapter(adapter);

Exit application programmatically

I have been searching for an answer but I couldn't find a proper one. The question is that I have a dialog themed activity on top of a normal activity. I would like to force the users to either read and click "OK" to the themed activity which will then transfer them to another dialog themed activity for some further questions or cannot enter the application. So, I would like to exit the application, on back press, and not just finish the themed activity that will reveal the content of my app. How is that possible?

How can i convert from String token fron edit text to integer in android

how can I get the data from edit text (the input type of the edit text is integer), I tried this code but it shows RunTime Error: CaseAge=(EditText) findViewById(R.id.editText2); String age =CaseAge.getText().toString(); case1.setAge(Integer.parseInt((age)); actually the problem with this line: case1.setAge(Integer.parseInt((age)); thank you so much,

Android Calendar, get Event Id

i'm writing an application that need to add some events to a calendar in android. For inserting i just used the following code: public void onItemClick(AdapterView<?> adapter, View curview, int position, long id) { WhoisEntry entry = this.adapter.getItem(position); String domainName = entry.getDomainName(); Date expDate = entry.expirationDate; Toast.makeText(getApplicationContext(), "Domain: " + domainName, Toast.LENGTH_SHORT).show(); Calendar cal = Calendar.getInstance(); Intent intent = new Intent(Intent.ACTION_EDIT); intent.setType("vnd.android.cursor.item/event"); intent.putExtra("beginTime", entry.expirationDate); intent.putExtra("allDay", false); intent.putExtra("endTime", cal.getTimeInMillis()+60*60*1000); intent.putExtra("title", "Expiration of " + entry.domainName); startActivity(intent); } Now i'm wondering if is possibl

Creating & Updating the data medium

I have a program that displays information which constantly changes. This program is stored as an HTML file and the actual information is calculated using several javascript files; all of this is located on a server. Though the program isn't tidy it does what I want - it writes the data (lat & long) to a < p > tag in the HTML. My question is what is the easiest way to access this data from an android device? I don't simply want to load the screen on a web view. I want this specific information. Can data which updates frequently be scraped from a website? Or would it be better practice to add the frequently updating data to a separate file like an XML file or a database can have the app constantly download this file using a service? If so is javascript capable of writing to this XML or database file? Thanks!

Can"t invoke GreenDroid PagedView OnClickListener

this is my first time asking question here, hope that someone nice could help me. I'm using GreenDroid PagedView, but I want to click on the pagedView,and it simply not response. I've tried to log in onClickListener method. But I just can't get that log. The reason is that when i click on the screen ,seems that it don't invoke onClick method. Anyone would help me? Follow GreenDroid on GitHub Here. https://github.com/cyrilmottier/GreenDroid You can download and just run it ,no need to modify anything if you use Eclipse IDE. CDCatalog-PagedViewActivity I just want to click on PagedView.

Is it possible to turn on synch in Android Account

I'm working on an application that will allow a user to turn on/off synching for their exchange email account. I am able to get the exchange account using: Account[] accs = AccountManager.get(this).getAccountsByType("com.htc.android.mail.eas"); but the Account API doesn't seem to offer what I'm looking for. I have also found ContactsContract.Settings database table which stores synch data, but I'm not that sure where to start with that. Any ideas?

Moving files from sdCard to flash memory in android?

I am working on an app which needs to move the files from sdcard to the flash memory .The problem is that both the flash memory and sdcard is detected by : (Environment.getExternalStorageDirectory()) So I cant detect whether sdcard is inserted or not . Has anyone came across the same problem please help ? I am using Archos 7 home tablet eclair. I need to know how can I get the path for the flash memory and sdcard.

Android 4.0: canvas.setViewport error

I'm getting an error in my code. the method setViewPort(int, int) cannot be defined for the type canvas. I am trying to implement multi touch functionality on an ImageView, the intire class is far too long to put up here but if you require more information just comment. @Override protected void onDraw(Canvas canvas) { if(layout) { if(!viewSet) { //line that's causing issue canvas.setViewport(displayWidth, displayHeight); viewSet = true; } can't figure out what the issue is, have all necessary imports etc. Would it be the fact I'm using Android 4.0? thanks. Shaw

C++ - inheriting ostream crashes on android but not windows

I have implemented a simple ostream and streambuf class. For some reason, it crashes when I try to instantiate my AndroidLogOStream object. Note: I have stlport_static in my Application.mk class AndroidLogStreamBuf : public std::streambuf { public: inline AndroidLogStreamBuf() : std::streambuf() { //std::cout << "asdfg"; } inline ~AndroidLogStreamBuf() { } }; class AndroidLogOStream : public std::ostream { public: inline AndroidLogOStream() : std::ostream(&mBuf) { } inline ~AndroidLogOStream() { } private: AndroidLogStreamBuf mBuf; }; It's barebones, and it runs fine on windows. It compiles fine on android, but it crashes for some reason. The last line it tries to execute is in _streambuf.c:46: template <class _CharT, class _Traits> locale basic_streambuf<_CharT, _Traits>::pubimbue(const locale&

Past Alarm Trigger

Will the alarm trigger if the trigger Time is set to past Time? For example, if the current time is 17:00 PM and if I set the alarm as 15:00 which is already passed, will the alarm be triggered?

onTouch not working?

Why its not going in onTouch method ? I am using Activity that implements onTouchListener and also I have android:onClick = ObjectClick in my xml where ObjectClick handles the click of the view . I am just using onTouch to get x , y but its not going in to ontouch function public class GamePlayActivity extends Activity implements View.OnTouchListener { int click_Locn_x=1,click_Locn_y=1; // onCreate function is also there ..... public void objectClick(View objectClicked) { Toast msg; int [] locationOfViewInScreen=new int[2]; int Object = objectClicked.getId(); View img= (View)findViewById(Object); img.getLocationOnScreen(locationOfViewInScreen); Log.d("Check:","locn of Image" + locationOfViewInScreen[0]+ " "+ locationOfViewInScreen[1]); Log.d("Check:","locn of click" + click_Locn_x + " "+ click_Locn_y); } @Override public boolean onTouch(Vi

Using resources referenced in the current theme

I find myself again trying to use resources set in the current theme inside my Android application and running into difficulties. Following the rough guidelines found here for theme attribute value reuse I was originally trying to create a selector like so <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="?android:attr/selectableItemBackground" /> <item android:drawable="@color/transparent" /> </selector> where the pressed state drawable is declared like so <item name="selectableItemBackground">@android:drawable/item_background</item> in the current ICS themes xml doc themes xml doc . This compiles fine in eclispse (whereas if i spell the attr wrong it will give an error or reffng @android:drawable/item_background directly will inform me the draw

Android WebServiceCall

I have a webservice call in my code through wss client++ . The first time i call it works and the result from the call is shown in another page(the web service is called on clicking a button).I have a back button in the new page which when clicked takes me back to the previous page.Again when i click the button for the web service call, it sometimes work and sometimes not. Can anyone suggest why is it failing?

My Program stops after 2nd intent in android

My android application stops after startActivity () call of my 2nd intent. It works perfectly for the first time with intents. But on the 2nd time its control doesn't pass to 3rd activity. I haven't displayed anything on 2nd activity. Is it the problem? Or is something with my AndroidManifest.xml file? Can some one help me? I have added the intent filter of three activities as shown below.Is it the problem? I am new to android so please help me! <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter>

Android JAVA String Validation

i have a question : I want to create an app that take a String from user input. This String will be in an email format. So there's some requirement's : .(full stop) can't be placed before @ .(full stop) and @ can't be more than one .(full stop) and @ can't be side by side Note : This is NOT a school homework(i just felt that this is like a homework after i typed it), i just want to learn more about String :D I already did some research's but i still can't solve those problem's :D Thanks all, and sory if i made some mistake's, English is not my native languange :D

Show an String XML data on a view without parsing

I have a String like this: <p><span class="qlst"> <span class="caption">QuickLinks</span> <ul> <li><a href="./journal/molecules/about#aims">Aims</a></li> <li><a href="./journal/molecules/about#scope">Scope</a></li> <li><a href="./journal/molecules/about#indexing">Indexing &amp; Abstracting</a></li> </ul> </span></p> <p><i>Molecules</i> (ISSN 1420-3049, CODEN: MOLEFW) is an open access journal of synthetic organic chemistry and natural product chemistry. All articles are peer-reviewed and published continously upon acceptance. <i>Molecules</i> is published by MDPI, Basel, Switzerland.</p> <h2><a name="aims"></a>Aims</h2> <p>Our aim is to encourage chemists to publish as much as possible their experimental detail, particular

Printing custom html from android app using PrinterShare

I am printing a custom html from my app using PrinterShare . The reason why I'm using html is because, I'm changing the contents of the html by passing name value pairs through a query string. My html file is pretty simple and I have stored it under asset. When I try to access it as: Intent i = new Intent(Intent.ACTION_VIEW); i.setPackage("com.dynamixsoftware.printershare.amazon"); Uri printFileUri= Uri.parse("file:///android_asset/receipt-voucher.html?shopName=BTMShop&date=20/12/2007&serial=1121"); i.setDataAndType(printFileUri,"text/html"); startActivity(i); The PrinterShare app is giving the web page unavailable error. So for testing purpose I created a text file under assest flder and tried to access it as- Uri printFileUri= Uri.parse("file:///android_asset/test.txt"); and changed the data and type. But even for the text file, I'm getting the error: No such file or directory from PrinterShare. I have made th

Android : testing a service

we are actually developping an audio service (in the android sense of the term) and we have quite of lot of tests to cover many aspects of our APIs. But we are actually wondering for good things to do to test a service efficiently. So this question is quite open: how would you test an android service ? We are currently using JUnit + EasyMock on test both on real devices and Continous Integration server (via an emulator). Any suggestion is welcome, thx in advance. PS : we have been searching SOF for similar threads but we just found a few cues in those depleted threads : Instrumentation Test case how to bind service from activity Android Service Testing Why is an Android Service not singleton when testing?

Horintal scrollview END point and start point

i have Horizontal scrollview with 50 controll,as i am scroll it will display 50 gracefully.but at initially user not able to understand that this is scrollview and "I need to scroll for next item". so i have simply put two image at Right side and left side as you can see in image.now my problem is "i don't able to understand that how can i invisible left side arrow to visible & invisible right side arrow".

Android UTF-8 edittext not displayed

I want to display some UTF-8 characters (upside down) in my edittext: ʇxǝʇ ǝɯos This works for the all characters, except the e . The e can't be displayed in the edittext. Is there a reason why it can't be displayed? the "e" is of type LATIN_EXTENDED_B, can't android display those characters ? Thanks!

Robotium side scroll not working for me

I want to scroll left/right on an android application using a Robotium/Junit test. There is a function in Robotium called: solo.scrollToSide(int); But, what do I put for the int? what is the value for RIGHT and what is the value for LEFT? I tried 0,1,2,3, and 4... no luck :( Thanks EDIT: I found the answer. RIGHT is 22 and LEFT is 21.

AJAX to Sharepoint Server with Phonegap and JQuery Mobile not working

I have the following Problem. In the Phonegap App(for Android) I want to make an AJAX-Call to connect with a Sharepoint Server, with the following Code: $.ajax({ url:"https://xxx/_vti_bin/lists.asmx", beforeSend: function( xhr ){ xhr.setRequestHeader( "SOAPAction", "http://schemas.microsoft.com/sharepoint/soap/GetListCollection" ); xhr.setRequestHeader("Content-Type","text/xml; charset=utf-8"); }, dataType:"xml", contentType: "application/xml; charset=utf-8", timeout:10000, type:'POST', cache: false, username: "username", password: "password", data: soapEnv, success:function(data) { // alert data var serializer = new XMLSerializer(); serialized = serializer.serializeToString(data); alert(serialized); }, error:function(XMLHttpRequest,textStatus, errorThrown) { // alert errors aler