Jump to content

Search the Community

Showing results for tags 'android'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 9 results

  1. Hi Does anyone know how I can connect a thermal printer from my Samsung tab to print to the printer? The printer is not a Bluetooth printer. It is connected to the system via a cable. I have checked and it seems the printer does not have an ip address either. Was thinking I could connect via the system ip address when shared. I have tried many android app including printshare and mobiprint rawbt but I wasn't able to connect the printer to the tab. I don't know if I was doing something wrong though. If any has done something like that, please I'd like to know. Thanks
  2. I have php code that uses mp3 audio files stored in a database for the user to listen to. The page loads and the audio controls work and the files play on a desktop and laptop just fine. When trying to play a file on an android or IPhone, when you press the play (or any other control) nothing happens. It acts like the page is static. There is a home button on the webpage and it works so I know the page is interactive. Below is the code. I would appreciate any help. Thank you. <?php $sermons = $database->select("sermon","*");; foreach( $sermons as $sermon ) { $audio_file = 'http://xxxxxxx.com/sermons/'.$sermon['file_name']; $player = "<audio id='sermon_'$sermon[id] controls> <source src='$audio_file' type='audio/mpeg'> <source src='$audio_file' type='audio/mp3'> Your browser does not support the audio element. </audio>"; echo "<tr> <td>$sermon[sermon_date]</td> <td>$sermon[title]</td> <td>$sermon[speaker]</td> <td>$player</td> </tr>"; } ?>
  3. Hi everyone, I'm new here and i'm also new with coding in PHP. I have written one Restful Api based on one tutorial and i need Restful Api for connecting my Android application to server. I need some help with making this to work. I need to update user details. This is the code i'm using: class DbHandler { public function updateUser($id, $name) { $stmt = $this->conn->prepare("UPDATE users SET name = ? WHERE id = ?"); $stmt->bind_param("is", $id, $name); $stmt->execute(); $num_affected_rows = $stmt->affected_rows; $stmt->close(); return $num_affected_rows > 0; } } This is preparation statement for updating a existing user. Now here is a fragment of code from index.php where i'm calling all methods: $app->put('/user/:id', 'authenticate', function($id) use($app) { verifyRequiredParams(array('name')); global $id; $name = $app->request->put('name'); $db = new DbHandler(); $response = array(); $result = $db->updateUser($id, $name); if ($result) { $response["error"] = false; $response["message"] = "User updated successfully"; } else { $response["error"] = true; $resopnse["message"] = "User failed to update. Please try again"; } echoRespnse(200, $response); }); When i try to send request, i'm getting only this: { "error": true } Any help would be appreciated. Thanks.
  4. I have a php application that serves pdf downloads. It works fine on all devices and browsers with one small but really annoying side-effect (edge-case for sure) When I look at my download logs anytime the download is triggered from Chrome on Android it is called twice! Bizarre behavior and I can't figure it out. Some background: The download is a pdf that get's created on the fly. All requests get processed through my index.php controller. I was serving the request with javascript via: window.open('export?file=something_to_inform_the_controller'); Works great in all browsers and devices but android chrome triggers this twice. So I got wise and though maybe a direct link would work better: <a target="_blank" href="http://mysite.com/export?file=abc123" download="file.pdf">DL link</a> or <a target="_blank" href="http://mysite.com/export?file=abc123">DL link</a> or <a target="_self" href="http://mysite.com/export?file=abc123" download="file.pdf">DL link</a> or <a target="_self" href="http://mysite.com/export?file=abc123">DL link</a> Nope, none of these flavors prevents android/chrome from double downloading. Then I researched my php header settings and tried: content-disposition: inline vs. content-disposition: attachment with no success Note, the download is logged when the controller processes the request for the download. I have duplicated download events for all downloads on android/chrome. It's strange that I have not found a solution online for this or maybe I'm overlooking something silly. Any ideas?
  5. Hello there, I have 3 years experience as php, js, css, html, jquery and java/android, worked with various CMS and Frameworks, find more in my portfolio:http://netkurator.ru/en-portfolio/ . Looking for long term and partial-time job. Hourly rate from 8$. Prefer to work through Odesk. With respect Roman.
  6. I've been struggling around about learning how HOTP (counter-based HOTP codes for Android Google Authenication ). I've found this code, which has the ability to share a secret key between the server and client ( Mobile APP ). <?php function oath_hotp($key,$counter) { // Convert to padded binary string $data = pack ('C*', $counter); $data = str_pad($data,8,chr(0),STR_PAD_LEFT); // HMAC return hash_hmac('sha1',$data,$key); } function oath_truncate($hash, $length = 6) { // Convert to dec foreach(str_split($hash,2) as $hex) { $hmac_result[]=hexdec($hex); } // Find offset $offset = $hmac_result[19] & 0xf; // Algorithm from RFC return ( (($hmac_result[$offset+0] & 0x7f) << 24 ) | (($hmac_result[$offset+1] & 0xff) << 16 ) | (($hmac_result[$offset+2] & 0xff) << 8 ) | ($hmac_result[$offset+3] & 0xff) ) % pow(10,$length); } print "<pre>"; print "Compare results with:"; print " http://tools.ietf.org/html/draft-mraihi-oath-hmac-otp-04\n"; print "Count\tHash\t\t\t\t\t\tPin\n"; for($i=0;$i<10;$i++){ print $i."\t".($a=oath_hotp("mysecretvalue",$i)); print "\t".oath_truncate($a)."\n"; } ?> This Output the following - Compare results with: http://tools.ietf.org/html/draft-mraihi-oath-hmac-otp-04 Count Hash Pin 0 f25e6c58cc7a2dfedae7eb48a1bff891aa0c0189 472801 1 b52adf13022511f08740566fb44c0b267d7c2604 983856 2 3c693c66f6e04178943dc9badc0dd41318dbc7f7 981065 3 1225cf508043a59fe2e39e335ff5f3e5795131ba 683381 4 21a9756e8de58df5e10c9292e0147823ba03539b 675192 5 7339c3496cebdaf3a035eaba888f61d8c19d8cf9 575624 6 c7c03ce2174f144a329664d35cc90e70a3686596 406934 7 431a75f26b9950f0206911667f3a2ed7fdfc43c7 172241 8 81e05a2d9e060a25f515b1e53170dce4daad5cc7 818865 9 ff2068918dc53db45a0c338d8de99419cf3cb571 723917 Now my problem is that I can not manage for above code to work properly on both Client and Server side. I've used the same Secret key print $i."\t".($a=oath_hotp("mysecretvalue",$i)); The output is completely different. Please note this is counter based which means there is no time sync like TOTP. I've doubled check my secret code on my android phone and server side. What could be wrong? Please note I'm not really familiar with PHP security. So if the above does not work with Google's Authentication please provide me with a place to start with. Thank You
  7. If you have a look at The attached picture, taken on my iPad just now you will see 3 app downloads buttons. The top One links to app.php?id=android the middle one links to app.php?id=iphone and the bottom one links to app.php?id=ipad. Obviously on this occasion only the 3rd link should be visible and the other 2hidden as I am viewing on my iPad. If I was to view on my iPod touch then only the middle one should be visible. My code for the index.php page in the screenshot is this: <?PHP include_once('include/connection.php'); include_once('include/article.php'); $category = new category; $articles = $category->fetch_all(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Xclo.mobi</title> <link type="text/css" rel="stylesheet" href="other.css" /> <link rel="apple-touch-icon" href="homescreen.png" /> <link href="startup.png" rel="apple-touch-startup-image" /> <script type="text/javascript"> var bodyclass ='desktop'; if ( (navigator.userAgent.indexOf('android') != null) ) { bodyclass = 'android'; } else if((window.navigator.userAgent.match('iphone') != null)||(window.navigator.userAgent.match('iPod') != null)) { bodyclass = 'iphone'; } else if (window.navigator.userAgent.match('ipad') != null){ bodyclass = 'ipad'; } window.onload = function(){ document.body.className += ' '+ bodyclass; } <script> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-34172259-1']); _gaq.push(['_setDomainName', 'xclo.co.uk']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </head> <body> <?php include_once('header.php'); ?> <div id="content"> <ul class="pageitem"><li class="button android"><input name="Submit" value="App Downloads" onclick="window.location='apps.php?id=android' " type="submit" /></li></ul> <ul class="pageitem"><li class="button iphone"><input name="Submit" value="App Downloads" onclick="window.location='apps.php?id=iphone' " type="submit" /></li></ul> <ul class="pageitem"><li class="button ipad"><input name="Submit" value="App Downloads" onclick="window.location='apps.php?id=ipad' " type="submit" /></li></ul> <?php foreach ($articles as $article) { ?> <ul class="pageitem"><li class="button"> <a href="list.php?id=<?php echo $article['promo_cat']; ?>"> <input type="submit" name="Submit" value="<?php echo $article['promo_cat']; ?>"/> </a></li></ul> <?php } ?> </div> <br><center> <SCRIPT charset="utf-8" type="text/javascript" src="http://ws-eu.amazon-...d9-6cf16307e855"> </SCRIPT> <NOSCRIPT><A HREF="http://ws-eu.amazon-...t">Amazon.co.uk Widgets</A></NOSCRIPT></center> <?php include_once('footer.php'); ?> </body> </html> Any ideas on how to get this to work please. Thank you.
  8. Hi all. I'm building a site (which you will be able to find here: http://www.xclo.mobi/xclo2) and have a list of categories on this site. Each category on that page is linked to an item In my Database. Which then displays more content once clicked. I have a separate database form within the same database called apps (instead of mobi). Inside this I have a list of apps available but some apps are for selected devices. For example some apps link to google play and can only be displayed on an android device as displaying these on another device (ios for example) can be seen as pointless. The same goes for displaying iPad apps on an iPhone and also on an android as these can be seen as pointless. The device is saved in my apps database under the field "device" and have one of these categories iPhone iPad or android, What I would like is to display a category on my index page along side my other ones which say "APP DOWNLOADS". And once clicked it only displays the relevant apps available just like my current promotions on my site. But I only want the link to appear if they are on one of these devices: iPod touch, iPhone, iPad mini, iPad, android as these are the only devices that I have content for at the moment. For example. If you are viewing on a blackberry or a windows 8 or even a Firefox phone then this category will not show up. Please can someone tell me how to do this? Thank you. My code for my index page is: <?PHP include_once('include/connection.php'); include_once('include/article.php'); $category = new category; $articles = $category->fetch_all(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Xclo.mobi</title> <link type="text/css" rel="stylesheet" href="other.css" /> <link rel="apple-touch-icon" href="homescreen.png" /> <link href="startup.png" rel="apple-touch-startup-image" /> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-34172259-1']); _gaq.push(['_setDomainName', 'xclo.co.uk']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </head> <body> <?php include_once('header.php'); ?> <div id="content"> <?php foreach ($articles as $article) { ?> <ul class="pageitem"><li class="button"> <a href="list.php?id=<?php echo $article['promo_cat']; ?>"> <input type="submit" name="Submit" value="<?php echo $article['promo_cat']; ?>"/> </a></li></ul> <?php } ?> </div> <br><center> <SCRIPT charset="utf-8" type="text/javascript" src="http://ws-eu.amazon-adsystem.com/widgets/q?rt=tf_sw&ServiceVersion=20070822&MarketPlace=GB&ID=V20070822%2FGB%2Fxclo-21%2F8002%2Fc2cd2f40-ca29-49bc-add9-6cf16307e855"> </SCRIPT> <NOSCRIPT><A HREF="http://ws-eu.amazon-adsystem.com/widgets/q?rt=tf_sw&ServiceVersion=20070822&MarketPlace=GB&ID=V20070822%2FGB%2Fxclo-21%2F8002%2Fc2cd2f40-ca29-49bc-add9-6cf16307e855&Operation=NoScript">Amazon.co.uk Widgets</A></NOSCRIPT></center> <?php include_once('footer.php'); ?> </body> </html> Please help. Thank you.
  9. Hiya I've been searching for an encompassing solution to a problem for 2 days now and was wondering if anybody could shed some light on it? I've setup a html5 video to play on various web browsers and finally got it to work for android phones. I also use flash for older browsers that will not work with the html5 code. Android seems to be the most tricky as it requires js to call the video to play. Furthermore Its worth noting as far as I have seen that android doesnt even support https video streaming which is a nightmare and pretty short sighted of them. Heres the working code so far: <script> function vidEvent() { var videos = document.getElementsByTagName('video'); var vidCount = videos.length; for(i=0;i<vidCount;i++) { videos[i].addEventListener('click',bang,false); } } function bang() { this.play(); } window.onload = vidEvent; </script> <video width="560" height="320" autoplay="autoplay"> <source src="videos/Landing-Page.mp4" type="video/mp4" /> <source src="videos/Landing-Page.mv4" type="video/mv4" /> <source src="videos/Landing-Page.ogv" type="video/ogg" /> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="320"> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data="videos/player.swf" width="560" height="315"> <!--<![endif]--> <param name="movie" value="videos/player.swf" /> <param name="wmode" value="transparent" /> <param name="bgcolor" value="#FFFFFF" /> <param name="quality" value="high" /> <param name="allowFullScreen" value="true" /> <param name="allowscriptaccess" value="always" /> <a href="http://www.adobe.com/go/getflash"> <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /> </a> <param name="flashvars" value="vdo=videos/Landing-Page.flv&autoplay=true" /> <!--[if !IE]>--> </object> <!--<![endif]--> </object> </video> Ok so it works on android phones (galaxy s i9000) and works in FF (if http NOT https), Chrome, IE and Safari (on my laptop). It doesn't seem to work on iphones at all so would assume thats the same for ipads.. Can you see anything obviously wrong with my code? I wonder if the js is causing the problem with iphone. Does any body know of a workable solution where a html5/flash video can be embeded on a website to be able to play on iphone/ipad, kindle, android and desktop/laptop older browsers. If anybody can shed any light on this I would so happy because this is just a mine field. Thank you
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.