Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Yaron

  1. I've noticed 2 new warnings when uploading to the play store: --- Warning This App Bundle contains Java/Kotlin code, which might be obfuscated. We recommend you upload a deobfuscation file to make your crashes and ANRs easier to analyze and debug. Warning This App Bundle contains native code, and you've not uploaded debug symbols. We recommend you upload a symbol file to make your crashes and ANRs easier to analyze and debug. --- These warnings only affect ANR reports, but should I take steps to correct them?
  2. I use an FMX TWebBrowser component with Android to display a web form. The form is used to upload an image to a web server, however, after loading the web-page, clicking on the form's "Browse" button does absolutely nothing. Ideally, I would want Android to trigger the gallery app to select a picture for upload (like it does if I open the same URL with chrome/firefox), any ideas?
  3. Yaron

    My open-source portfolio

    I released quite a bit of interesting code to github over the years: YouTube DATA API v3 parsing: https://github.com/bLightZP/Delphi-YouTube-Channel-parsing-plugin-for-Zoom-Player Basic RSS feed parsing code: https://github.com/bLightZP/Delphi-RSS-feed-parsing-plugin-for-Zoom-Player TheAudioDB MetaData/Image scraping code: https://github.com/bLightZP/Delphi-theaudiodb.com-Zoom-Player-media-scraping-plug-in TheMovieDB MetaData/Image scraping code: https://github.com/bLightZP/Delphi-themoviedb.org-Zoom-Player-media-scraping-plug-in OpenSubtitles.org subtitle search & scrape code: https://github.com/bLightZP/Delphi-OpenSubtitles.org-API-support-for-Zoom-Player A basic cross-platform calculator https://github.com/bLightZP/ElegantCalculator https://play.google.com/store/apps/details?id=com.inmatrix.ElegantCalculator Adapted old code to work as cross-platform pure-pascal image scaling with filters (bicubic, bilinear, etc): https://github.com/bLightZP/ImageInterpolation Adapted old code to work as a cross-platform drawing of an anti-aliased circle (can be modified to draw rount-rect as well): https://github.com/bLightZP/AntiAliasedCircle I forked a QRCode generating source code and greatly optimized it (~ x50 faster): https://github.com/bLightZP/DelphiZXingQRCode The original Delphi scanline color-conversion implementation was very slow, so I optimized it: https://github.com/bLightZP/OptimizedDelphiFMXScanline
  4. I'm not using any external java files.
  5. I know Delphi 7 is old, but I have projects that I maintain and once I upgraded to Windows 10, compilation/running is a lot slower compared to Win 7 (on the same machine). I believe it may has something to do with the real-time virus protection (which I disabled in Win7 and is very hard to disable in Win10), but there may be other factors I'm not aware of. Does anyone have any tips to speed things up?
  6. @aehimselfnot using a VM @dummzeuchI changed the folder permission to allow full control to the user-account, had the same setup in Win7.
  7. @rvk Thank you, I've disabled exploit protection for "c:\Program Files (x86)\Borland\Delphi7\Bin\delphi32.exe" and my app's executable to see if it helps. @Arnaud Bouchez I wasn't ware of delphispeedup, I'll give it a shot. And by "slow", I mean about 50% slower compile times and longer load time when running the app from within Delphi.
  8. I've added the entire Delphi folder and my entire development partition (all my projects are on a separate drive) to the Exclusion list, but it didn't have an impact on the compilation/execution slowdowns. I tried the compatibility troubleshooter which suggested running as Win XP SP3, but when doing so, I couldn't even run my applications from Delphi, it just froze. Trying Win7 compatibility now to see if it works any better (at least apps run).
  9. Doesn't look like there's going to be an official patch, but it took me less than 5min to get this done, so it's not that tedious.
  10. Horácio posted a fix in the original thread, I verified that it works on a OnePlus 7 device running Android 10.
  11. I can't even vote because my subscription ran out...
  12. I got a DM with a request on how I added Android AdMob interstitial ads, here's the code: First the definition: {$IF DEFINED(ANDROID) and DEFINED(ADMOB_FULLPAGE)} TInterStitialAdViewListener = class(TJavaLocal, JIAdListener) private FAD: JInterstitialAd; public constructor Create(AAD: JInterstitialAd); procedure onAdClosed; cdecl; procedure onAdFailedToLoad(errorCode: Integer); cdecl; procedure onAdLeftApplication; cdecl; procedure onAdOpened; cdecl; procedure onAdLoaded; cdecl; end; {$ENDIF} [code] Then in the private section of the main form: [code] {$IF DEFINED(ANDROID) and DEFINED(ADMOB_FULLPAGE)} LAdViewListener : TInterStitialAdViewListener; FInterStitial : JInterstitialAd; {$ENDIF} In the form's onCreate: {$IFDEF ADMOB_FULLPAGE} FInterStitial := TJInterstitialAd.JavaClass.init(MainActivity); {$IFDEF TRACEDEBUG} FInterStitial.setAdUnitId(StringToJString('ca-app-pub-3940256099942544/1033173712')); // google test ad {$ELSE} FInterStitial.setAdUnitId(StringToJString('ca-app-pub-xxxxxxxxxxxxxxxxxxx/xxxxxxxxxxx')); // real ad code {$ENDIF} {$ENDIF} And finally: {$IF DEFINED(ANDROID) and DEFINED(ADMOB_FULLPAGE)} constructor TInterStitialAdViewListener.Create(AAD: JInterstitialAd); begin inherited Create; FAD := AAD; {$IFDEF TRACEDEBUG}AddDebugEntry('InterStitialAdViewListener created');{$ENDIF} end; procedure TInterStitialAdViewListener.onAdClosed; begin {$IFDEF TRACEDEBUG}AddDebugEntry('InterStitialAdViewListener AdClosed event');{$ENDIF} //MainForm.ShowModal; end; procedure TInterStitialAdViewListener.onAdFailedToLoad(errorCode: Integer); begin {$IFDEF TRACEDEBUG}AddDebugEntry('InterStitialAdViewListener AdFailedToLoad code #'+errorCode.toString);{$ENDIF} {$IFDEF TRACEDEBUG}ShowMessage('AdFailedToLoad code #'+errorCode.toString);{$ENDIF} end; procedure TInterStitialAdViewListener.onAdLeftApplication; begin {$IFDEF TRACEDEBUG}AddDebugEntry('InterStitialAdViewListener AdLeftApplication');{$ENDIF} end; procedure TInterStitialAdViewListener.onAdLoaded; begin {$IFDEF TRACEDEBUG}AddDebugEntry('InterStitialAdViewListener AdLoaded');{$ENDIF} FAD.show; end; procedure TInterStitialAdViewListener.onAdOpened; begin {$IFDEF TRACEDEBUG}AddDebugEntry('InterStitialAdViewListener AdOpened');{$ENDIF} end; procedure TMainForm.ShowInterStitialAd; var LADRequestBuilder: JAdRequest_Builder; LadRequest: JAdRequest; begin LADRequestBuilder := TJAdRequest_Builder.Create; {$IFDEF TRACEDEBUG}LADRequestBuilder.addTestDevice(MainActivity.getDeviceID);{$ENDIF} LadRequest := LADRequestBuilder.build(); LAdViewListener := TInterStitialAdViewListener.Create(FInterStitial); CallInUIThread( procedure begin FInterStitial.setAdListener(TJAdListenerAdapter.JavaClass.init (LAdViewListener)); FInterStitial.loadAd(LadRequest); end); end; {$ENDIF}
  13. I am trying to write Android intent code so when a user chooses to share text with another application, my app will appear twice as an option, each with a different label and a mechanism I can distinguish between the two intents. Basically, I'm trying to have "Play" and "Queue" options for URLs shared from the YouTube app. I have no issues with just one intent, defining in "AndroidManifest.template.xml" <intent-filter> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="text/plain" /> </intent-filter> And in code: // Register the type of intent action that we want to be able to receive. // Note: A corresponding <action> tag must also exist in the <intent-filter> section of AndroidManifest.template.xml. MainActivity.registerIntentAction(TJIntent.JavaClass.ACTION_SEND); TMessageManager.DefaultManager.SubscribeToMessage(TMessageReceivedNotification, HandleActivityMessage); procedure TMainForm.HandleActivityMessage(const Sender: TObject; const M: TMessage); begin if M is TMessageReceivedNotification then HandleIntentAction(TMessageReceivedNotification(M).Value); end; function TMainForm.HandleIntentAction(const Data: JIntent): Boolean; var Extras : JBundle; sURL : String; begin Result := False; if Data <> nil then begin Extras := Data.getExtras; if Extras <> nil then Begin sURL := JStringToString(Extras.getString(TJIntent.JavaClass.EXTRA_TEXT)); {$IFDEF TRACEDEBUG}AddDebugEntry('Intent string "'+sURL+'"');{$ENDIF} Extras := nil; End end end; How can I add a second intent?
  14. If anyone is interested, here's the relevant section of the manifest file after I tested it works correctly: <activity android:name="com.embarcadero.firemonkey.FMXNativeActivity" android:label="ZP Remote" android:configChanges="orientation|keyboard|keyboardHidden|screenSize" android:launchMode="singleTask"> <!-- Tell NativeActivity the name of our .so --> <meta-data android:name="android.app.lib_name" android:value="ZP_Remote" /> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter android:label="Play in ZP"> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="text/plain" /> </intent-filter> </activity> <activity-alias android:targetActivity="com.embarcadero.firemonkey.FMXNativeActivity" android:name="com.embarcadero.firemonkey.FMXNativeActivity.Queue"> <!-- Put second SEND action inside activity-alias tag --> <intent-filter android:label="Queue in ZP"> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="text/plain" /> </intent-filter> </activity-alias>
  15. I am trying to upload JSON data and an image as a MultipartFormData and return a JSON string from mars using the following code: var shareData : TMultipartFormData; jsonStr : String; begin shareData := TMultipartFormData.Create; shareData.AddField('json','{"empty":"empty"}'); shareData.AddFile('image',FileName); jsonStr := NetHTTPRequest.Post(urlAPIBase+urlAPIShareImage,shareData).ContentAsString(TEncoding.UTF8); end; How do I setup mars to give me access to the json field and image fields? I looked at the ContentTypes demo, but I wasn't sure if any of the examples actually covered MultipartFormData.
  16. @Dave Nottage Yes, I am working with the same "SEND" action. I read the article you linked to, but didn't see any mention regarding the same action used more than once. I did get an answer on stackoverflow that I should use an Activity Alias, but haven't had time to test it yet and I haven't figured out yet (mainly due to lack of time) how to do this in delphi : if (intent.component.className.endsWith(".Queue"){ // putting data in the queue... } else { // playing requested data... }
  17. I tried modifying the manifest file to include two entries with different labels: <intent-filter android:label="Play in XX"> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="text/plain" /> </intent-filter> <intent-filter android:label="Queue in XX"> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="text/plain" /> </intent-filter> However, only the first entry shows up in YouTube and on top of that I'm not even sure how to read the label value from my Delphi code so I can distinguish between the two call even if YouTube did list them.
  18. I don't see the mechanism that would allow me to distinguish between multiple intents. I don't understand how calling "MainActivity.registerIntentAction(TJIntent.JavaClass.ACTION_SEND);" again would help.
  19. You are not very clear, I believe mars translates everything to unicode, I have no issues with UTF8 encoded content.
  20. Yaron

    [Source code for sale] Automated Whatsapp server

    It looks like you're hooking into the browser version of whatsapp, which browser interface are you using (explorer, chrome?) And since you're not using the API, wouldn't your code stop working as soon as whatsapp changes something in their browser implementation?
  21. Any reason you're looking to pass this information in the path instead of perhaps using a form POST that contains the relevant information?
  22. Is it possible to make a sort of "catch all" for all "GET/POST" commands that use a path not specified through mars? For example, I have mars specified to return a page using "http://website.com/rest/info" However, If the client opens the unspecified "http://website.com/rest/none" path, MARS throws an exception. Instead of the exception, I want to catch all unspecified paths and return an HTML result (and keep a record of the unspecified path in my debug logs). Is this possible?
  23. I'm using AJAX forms with javascript's "history.pushState" to preserve the browser's "back" button functionality. So if my entry point is "https://myserver.com/v/site/", clicking on a link would look like "https://myserver.com/v/site/page1/" without any actual page being loaded (only part of the page). My problem is that when the user tries to refresh the page, MARS won't recognize the "https://myserver.com/v/site/page1/" path. In reality, I would like to redirect such URLs back to "https://myserver.com/v/site/". I tried registering the InvokeError procedure like this: TMARSActivation.RegisterInvokeError( procedure (const AActivation: IMARSActivation; const AException: Exception; var AHandled: Boolean) begin ShowMessage(AActivation.Request.URL); AHandled := True; end ); Which is triggered, but "AActivation.Request.URL" returns an empty string and I'm not sure how to perform the redirect... can you help?
  24. It seems that Delphi 10.3 generated APKs are not compatible with the NOX emulator running Android 7. The moment I try running the APK, I get a message that the application closed. This happens with every APK I generate (e.g. https://github.com/bLightZP/ElegantCalculator). Trying to debug the issue, it seems that my first line of code is not even executed before the app closes. Any ideas?
  25. I'm the author of Zoom Player a Windows media player/home theater application. One of Zoom Player's features is that it scrapes information on the video file using multiple mechanism. Two of these mechanisms are somehow severely lagging my user interface even though I'm running the code in separate threads with Idle priority: 1. Running MediaInfo.dll on the media file. 2. Using a non-visual background directshow graph using LAV Filters (directshow filters) to extract a video frame from the video. Other than moving this functionality to completely separate processes, is there a method to ensure my UI (running in the main thread) remains responsive?