B4A Library Library Create ShortLink

Hi all.

This is simple library create ShortLink.
I used this free service: PSBE:CO

Is very simple:

ShortLink
Author:
Devil-App
Version: 1.02
  • ShortLink
    Methods:
    • IsInitialized As Boolean
      Tests whether the object has been initialized.
    • Initialize (url As String, yourkey As String, Module As Object, EventName As String) As String


      For get your Key HERE

      B4X:
      Sub Activity_Create(FirstTime As Boolean)
          'Do not forget to load the layout file created with the visual designer. For example:
          'Activity.LoadLayout("Layout1")
          Dim createshortlink As ShortLink
          Dim url As String
          url = "https://www.google.it/search?sclient=psy-ab&biw=1600&bih=775&site=webhp&q=link+molto+lunghi+ma+molto+molto+lunghi&oq=link+molto+lunghi+ma+molto+molto+lunghi&gs_l=hp.3...1985656.1989803.0.1990495.22.14.0.0.0.0.0.0..0.0....0...1c.1.64.psy-ab..22.0.0.BN3qzQhL1aY&pbx=1&bav=on.2,or.r_cp.&bvm=bv.98197061,d.bGQ&ion=1&ech=1&psi=DKqsVY_pAcKtygPz_pjYAw.1437379086446.7&ei=DaqsVbuaDcjXygO3qK_oCA&emsg=NCSR&noj=1"
          createshortlink.Initialize(url,"Fe5pwHzYKdmshHMC2Kq7NUIN0X3Ap1J54u4jsn62nFgdNmBJX9", Me, "check_short")
         
      End Sub
      
      Sub check_short(valore As typeLevel)
      LogColor(valore.link, Colors.Red)
      ToastMessageShow(valore.link, True)
      Msgbox(valore.link, "Messaggio")
      End Sub

      LIBRARY
      - Unzip the attached file ( ShortLink-Lib.zip ) and copy ShortLink.jar and ShortLink.xml to the libraries folder
      - ShortLink-Example.zip is simple B4A

      Screenshot 2015-07-20 10.37.45.png
 

Attachments

  • ShortLink-Example.zip
    8 KB · Views: 211
  • ShortLink1.02-Lib.zip
    15.3 KB · Views: 195
Last edited:

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
Got this error log.
Please help:

B4X:
Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 30914 (config)
java.lang.NoClassDefFoundError: anywheresoftware.b4a.http.HttpClientWrapper


    at anywheresoftware.b4a.samples.httputils2.httputils2service._process_globals(httputils2service.java:137)
    at b4a.example.main.initializeProcessGlobals(main.java:335)
    at b4a.example.main.afterFirstLayout(main.java:94)
    at b4a.example.main.access$100(main.java:16)
    at b4a.example.main$WaitForLayout.run(main.java:76)
    at android.os.Handler.handleCallback(Handler.java:725)
    at android.os.Handler.dispatchMessage(Handler.java:92)
    at android.os.Looper.loop(Looper.java:153)
    at android.app.ActivityThread.main(ActivityThread.java:5297)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
    at dalvik.system.NativeStart.main(Native Method)
 

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
Thank you @MarcoRome ,
but I still have this error log.

I updated the library, added the reference to library okHttp, but:


B4X:
java.lang.NoClassDefFoundError: anywheresoftware.b4a.objects.ServiceHelper$StarterHelper
    at devil.app.shortlink.httputils2service.onCreate(httputils2service.java:48)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:2671)
    at android.app.ActivityThread.access$1600(ActivityThread.java:156)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1422)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:153)
    at android.app.ActivityThread.main(ActivityThread.java:5297)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:511)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
    at dalvik.system.NativeStart.main(Native Method)
 

imgsimonebiliato

Well-Known Member
Licensed User
Longtime User
Maybe it is because I use b4a 3.82?
 

so27

Active Member
Licensed User
Longtime User
B4X:
createshortlink.Initialize(url,"Fe5pwHzYKdmshHMC2Kq7NUIN0X3Ap1J54u4jsn62nFgdNmBJX9", Me, "check_short")

This
Fe5pwHzYK...
Key.

2016-04-23_08h57_31.png
 

so27

Active Member
Licensed User
Longtime User
You write:
2016-04-23_08h59_54.png

And there are thousands of APIs. What I have to choose because since. What is the name of the API? Under psbe nothing is found. SDK is clear.
 

MarcoRome

Expert
Licensed User
Longtime User
You write:
View attachment 43451
And there are thousands of APIs. What I have to choose because since. What is the name of the API? Under psbe nothing is found. SDK is clear.

Hi so27, are you a few nervous today ?
For first thing i like when people start with "Hi"....
Hi you have picture:

Immagine.jpg


You try Click about link point 1, here you have 2 link :

First link --> Psbe.co, here you have official site, so you see documentation and information
Second Link --> Mashape, if in mashape you dont found nothing maybe it was deleted.

Anyway the key that you have in Example work. You can use this .

Nice day
 

so27

Active Member
Licensed User
Longtime User
Ahhhh, okay. Is the service because even available for free? Is there something you known?
 
Top